mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
The PyCOND_TIMEDWAIT must use microseconds for the timeout argument
in order to have the same resolution as pthreads condition variables. At the same time, it must be large enough to accept 31 bits of milliseconds, which is the maximum timeout value in the windows API. A PY_LONG_LONG of microseconds fullfills both requirements. This closes issue #20737
This commit is contained in:
parent
8577e5ae09
commit
ddf343855d
2 changed files with 7 additions and 7 deletions
|
@ -77,7 +77,7 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
|
|||
/* wait at least until the target */
|
||||
DWORD now, target = GetTickCount() + milliseconds;
|
||||
while (mutex->locked) {
|
||||
if (PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, milliseconds*1000) < 0) {
|
||||
if (PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, (PY_LONG_LONG)milliseconds*1000) < 0) {
|
||||
result = WAIT_FAILED;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue