From: Georg Brandl Date: Fri, 8 Jul 2005 22:26:13 +0000 (+0000) Subject: bug [ 1234979 ] Lock.acquire treats only 1 as True X-Git-Tag: v2.5a0~1604 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af410b510db2ecee4369ab217692f15bb3be85bc;p=thirdparty%2FPython%2Fcpython.git bug [ 1234979 ] Lock.acquire treats only 1 as True --- diff --git a/Misc/NEWS b/Misc/NEWS index b3a56b0a3c42..0af2c80fbaaf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -103,6 +103,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. - Patch #1212117: os.stat().st_flags is now accessible as a attribute diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 7d2290e6b88a..47c776f08088 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -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));