mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
bpo-33316: PyThread_release_lock always fails (GH-6541)
Use correct interpretation of return value from APIs.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
PyThread_release_lock always fails
|
||||
@@ -104,8 +104,9 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex)
|
||||
if (PyMUTEX_LOCK(&mutex->cs))
|
||||
return FALSE;
|
||||
mutex->locked = 0;
|
||||
result = PyCOND_SIGNAL(&mutex->cv);
|
||||
result &= PyMUTEX_UNLOCK(&mutex->cs);
|
||||
/* condvar APIs return 0 on success. We need to return TRUE on success. */
|
||||
result = !PyCOND_SIGNAL(&mutex->cv);
|
||||
PyMUTEX_UNLOCK(&mutex->cs);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user