mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the
lock was not acquired.
This commit is contained in:
parent
a82aa55b5e
commit
c2824d41c3
4 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue