Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af410b5

Browse files
committed
bug [ 1234979 ] Lock.acquire treats only 1 as True
1 parent 8b687cf commit af410b5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ Core and builtins
103103
Extension Modules
104104
-----------------
105105

106+
- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
107+
implemented treated all integer values except 1 as false.
108+
106109
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
107110

108111
- Patch #1212117: os.stat().st_flags is now accessible as a attribute

Python/thread_nt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
299299

300300
dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),aLock, waitflag));
301301

302-
success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag == 1 ? INFINITE : 0)) == WAIT_OBJECT_0 ;
302+
success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag ? INFINITE : 0)) == WAIT_OBJECT_0 ;
303303

304304
dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success));
305305

0 commit comments

Comments
 (0)