Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the

lock was not acquired.
This commit is contained in:
Victor Stinner 2011-04-24 23:41:33 +02:00
parent a82aa55b5e
commit c2824d41c3
4 changed files with 13 additions and 0 deletions

View file

@ -157,6 +157,8 @@ class _RLock(_Verbose):
def _release_save(self):
if __debug__:
self._note("%s._release_save()", self)
if self._count == 0:
raise RuntimeError("cannot release un-acquired lock")
count = self._count
self._count = 0
owner = self._owner