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

@ -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;