Pro tip: when acquiring locks, it is usually recommended to enclose the code until lock.release in try: ... finally:, to make sure that, even if an exception happens in the middle, the lock still gets released.  Otherwise, if an exception happens, the lock will never get released.
```python
lock.acquire()
try:
    # do stuff
finally:
    lock.release()
```
Another (simpler) way is to use the [with statement](http://docs.python.org/release/2.5/whatsnew/pep-343.html):
```python
with lock:
    # do stuff
```