summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/thread_nt.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index 61fa8619bc..56295d0e8c 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -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;
}