Commit 56452af7 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

locking: Don't fail in error handling if lock isn't owned

In case an exception was thrown while acquiring the lock, not necessarily all
owned locks are also really acquired. Before this change, an exception could be
masked by another exception thrown here. There is no good clean-up strategy
when acquiring a lock fails with an exception in either case.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent 752a8ca8
......@@ -775,7 +775,9 @@ class LockSet:
def _release_and_delete_owned(self):
"""Release and delete all resources owned by the current thread"""
for lname in self._list_owned():
lock = self.__lockdict[lname]
if lock._is_owned():
def __names(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment