Use 'with' instead of lock.acquire/release()