diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/pytime.h | 2 | ||||
-rw-r--r-- | Include/pythread.h | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Include/cpython/pytime.h b/Include/cpython/pytime.h index b5a351349f8..db3adfab6a9 100644 --- a/Include/cpython/pytime.h +++ b/Include/cpython/pytime.h @@ -14,7 +14,9 @@ extern "C" { store a duration, and so indirectly a date (related to another date, like UNIX epoch). */ typedef int64_t _PyTime_t; +// _PyTime_MIN nanoseconds is around -292.3 years #define _PyTime_MIN INT64_MIN +// _PyTime_MAX nanoseconds is around +292.3 years #define _PyTime_MAX INT64_MAX #define _SIZEOF_PYTIME_T 8 diff --git a/Include/pythread.h b/Include/pythread.h index bb9d8641221..cf4cc9a7473 100644 --- a/Include/pythread.h +++ b/Include/pythread.h @@ -61,9 +61,11 @@ PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock); convert microseconds to nanoseconds. */ # define PY_TIMEOUT_MAX (LLONG_MAX / 1000) #elif defined (NT_THREADS) - /* In the NT API, the timeout is a DWORD and is expressed in milliseconds */ -# if 0xFFFFFFFFLL * 1000 < LLONG_MAX -# define PY_TIMEOUT_MAX (0xFFFFFFFFLL * 1000) + /* In the NT API, the timeout is a DWORD and is expressed in milliseconds, + * a positive number between 0 and 0x7FFFFFFF (see WaitForSingleObject() + * documentation). */ +# if 0x7FFFFFFFLL * 1000 < LLONG_MAX +# define PY_TIMEOUT_MAX (0x7FFFFFFFLL * 1000) # else # define PY_TIMEOUT_MAX LLONG_MAX # endif |