diff options
author | Kristján Valur Jónsson <sweskman@gmail.com> | 2014-05-08 10:36:27 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <sweskman@gmail.com> | 2014-05-08 10:36:27 (GMT) |
commit | 33096fe8296b57c6e634e58af1c632b8e2f5bc05 (patch) | |
tree | ec9946bef242282eaf27805c77afeefac2c66627 /Python/thread_nt.h | |
parent | ba74885e0c3b738c75962a6afa2885a025f5239b (diff) | |
download | cpython-33096fe8296b57c6e634e58af1c632b8e2f5bc05.zip cpython-33096fe8296b57c6e634e58af1c632b8e2f5bc05.tar.gz cpython-33096fe8296b57c6e634e58af1c632b8e2f5bc05.tar.bz2 |
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
Diffstat (limited to 'Python/thread_nt.h')
-rw-r--r-- | Python/thread_nt.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h index ee2079f..84452cd 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -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; } |