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
|
@ -414,6 +414,12 @@ rlock_release_save(rlockobject *self)
|
|||
long owner;
|
||||
unsigned long count;
|
||||
|
||||
if (self->rlock_count == 0) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"cannot release un-acquired lock");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
owner = self->rlock_owner;
|
||||
count = self->rlock_count;
|
||||
self->rlock_count = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue