receiver: lock on actual handle, not just on handle number
This commit is contained in:
parent
0d9fe48b0c
commit
585a3b901a
|
@ -360,11 +360,11 @@ handles_lock = {}
|
||||||
|
|
||||||
def handle_lock(handle):
|
def handle_lock(handle):
|
||||||
with request_lock:
|
with request_lock:
|
||||||
if handles_lock.get(int(handle)) is None:
|
if handles_lock.get(handle) is None:
|
||||||
if _log.isEnabledFor(_INFO):
|
if _log.isEnabledFor(_INFO):
|
||||||
_log.info('New lock %s', int(handle))
|
_log.info('New lock %s', repr(handle))
|
||||||
handles_lock[int(handle)] = _threading.Lock() # Serialize requests on the handle
|
handles_lock[handle] = _threading.Lock() # Serialize requests on the handle
|
||||||
return handles_lock[int(handle)]
|
return handles_lock[handle]
|
||||||
|
|
||||||
|
|
||||||
# context manager for locks with a timeout
|
# context manager for locks with a timeout
|
||||||
|
|
Loading…
Reference in New Issue