[3.10] bpo-41710: Fix PY_TIMEOUT_MAX value on Windows#28672
[3.10] bpo-41710: Fix PY_TIMEOUT_MAX value on Windows#28672vstinner wants to merge 1 commit intopython:3.10from vstinner:timeout_max
Conversation
Fix _thread.TIMEOUT_MAX value on Windows: the maximum timeout is 0x7FFFFFFF milliseconds (around 24.9 days), not 0xFFFFFFFF milliseconds (around 49.7 days). Set PY_TIMEOUT_MAX to 0x7FFFFFFF milliseconds, rather than 0xFFFFFFFF milliseconds.
|
Oh, I read WaitForSingleObject documentation of 2006 for Windows CE 3.0:
Maybe this is different on Windows 10 and my change in the main branch is not correct. |
|
In ReactOS, WaitForSingleObject() calls WaitForSingleObjectEx() which converts "DWORD dwMilliseconds" to "LARGE_INTEGER Time" with BaseFormatTimeOut() Then WaitForSingleObjectEx() calls NtWaitForSingleObject() with the "LARGE_INTEGER Time". So I don't see any special case for values in the [0x80000000; 0xFFFFFFFE] range. Only INFINITE is special. In ReactOS, INFINITE is defined as: I understand that INFINITE is equal to 0xFFFFFFFF. |
|
The code in the main branch, I wrote PR #28673 to fix it instead. |
Fix _thread.TIMEOUT_MAX value on Windows: the maximum timeout is
0x7FFFFFFF milliseconds (around 24.9 days), not 0xFFFFFFFF
milliseconds (around 49.7 days).
Set PY_TIMEOUT_MAX to 0x7FFFFFFF milliseconds, rather than 0xFFFFFFFF
milliseconds.
https://bugs.python.org/issue41710