- changed status to resolved
Current use of manual get_lock, release_lock calls is not exception safe, the with statement can be used to ensure exception safety
Issue #9
resolved
From Martin Sandve Alnæs :
This code will cause problems (e.g. deadlocks) in instant today:
lock = get_lock(...)
do_something() # raises exception
release_lock(lock) # not released
The with
statement was introduced to python for precisely this reason, so we should make locking in instant work something like this:
with get_lock(...) as lock:
do_something() # raises exception
# python inserts a call to lock.__exit__() or something here, allowing exception safe lock release
Comments (1)
-
- Log in to comment
fixed by: 11500b370a827269c3e59f9a22fcd4a47999d056