diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index ec467ce64a..97667920c3 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -206,8 +206,8 @@ lock_PyThread_release_lock(lockobject *self, PyObject *Py_UNUSED(ignored)) return NULL; } - PyThread_release_lock(self->lock_lock); self->locked = 0; + PyThread_release_lock(self->lock_lock); Py_RETURN_NONE; } @@ -1393,8 +1393,8 @@ release_sentinel(void *wr_raw) if (obj != Py_None) { lock = (lockobject *) obj; if (lock->locked) { - PyThread_release_lock(lock->lock_lock); lock->locked = 0; + PyThread_release_lock(lock->lock_lock); } Py_DECREF(obj); }