gh-110014: Remove PY_TIMEOUT_MAX from limited C API#110217
gh-110014: Remove PY_TIMEOUT_MAX from limited C API#110217vstinner merged 2 commits intopython:mainfrom
Conversation
|
I fixed the PyThread_acquire_lock_timed() undefined behavior for very long timeout in Python 3.11 with commit 37b8294: The follow-up commit e444752 move to code to pytime.c. |
6e0bc01 to
420c75c
Compare
If the timeout is greater than PY_TIMEOUT_MAX, PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX microseconds, which is around 280.6 years. This case is unlikely and limiting a timeout to 280.6 years sounds like a reasonable trade-off. The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.
420c75c to
2388358
Compare
|
|
) If the timeout is greater than PY_TIMEOUT_MAX, PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX microseconds, which is around 280.6 years. This case is unlikely and limiting a timeout to 280.6 years sounds like a reasonable trade-off. The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.
If the timeout is greater than PY_TIMEOUT_MAX,
PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX microseconds, which is around 280.6 years. This case is unlikely and limiting a timeout to 280.6 years sounds like a reasonable trade-off.
The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.
📚 Documentation preview 📚: https://cpython-previews--110217.org.readthedocs.build/