]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport bug [ 1234979 ] Lock.acquire treats only 1 as True
authorGeorg Brandl <georg@python.org>
Fri, 8 Jul 2005 22:25:17 +0000 (22:25 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 8 Jul 2005 22:25:17 +0000 (22:25 +0000)
Misc/NEWS
Python/thread_nt.h

index fb0391f4cb2aa4158f1de53e3f48f9d3ab8a1c42..274d842689058d34e65bbb289330b4c1cc73073a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,9 @@ Core and builtins
 Extension Modules
 -----------------
 
+- Bug #1234979: For the argument of thread.Lock.acquire, the Windows 
+  implemented treated all integer values except 1 as false.
+
 - Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
 
 - Bug #1166660: The readline module could segfault if hook functions
index 7d2290e6b88ac816792f4fb7cebdc7c59da57ec6..47c776f080887aba631196795f172a7828c1b951 100644 (file)
@@ -299,7 +299,7 @@ int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
 
        dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),aLock, waitflag));
 
-       success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag == 1 ? INFINITE : 0)) == WAIT_OBJECT_0 ;
+       success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag ? INFINITE : 0)) == WAIT_OBJECT_0 ;
 
        dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success));