mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753)
PyTime_t no longer uses an arbitrary unit, it's always a number of nanoseconds (64-bit signed integer). * Rename _PyTime_FromNanosecondsObject() to _PyTime_FromLong(). * Rename _PyTime_AsNanosecondsObject() to _PyTime_AsLong(). * Remove pytime_from_nanoseconds(). * Remove pytime_as_nanoseconds(). * Remove _PyTime_FromNanoseconds().
This commit is contained in:
parent
69ab93082d
commit
e4c34f04a1
8 changed files with 57 additions and 100 deletions
|
@ -20,8 +20,8 @@
|
|||
|
||||
// Define PY_TIMEOUT_MAX constant.
|
||||
#ifdef _POSIX_THREADS
|
||||
// PyThread_acquire_lock_timed() uses _PyTime_FromNanoseconds(us * 1000),
|
||||
// convert microseconds to nanoseconds.
|
||||
// PyThread_acquire_lock_timed() uses (us * 1000) to convert microseconds
|
||||
// to nanoseconds.
|
||||
# define PY_TIMEOUT_MAX_VALUE (LLONG_MAX / 1000)
|
||||
#elif defined (NT_THREADS)
|
||||
// WaitForSingleObject() accepts timeout in milliseconds in the range
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue