]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-110014: Fix _POSIX_THREADS and _POSIX_SEMAPHORES usage (#110139)
authorVictor Stinner <vstinner@python.org>
Sat, 30 Sep 2023 17:25:54 +0000 (19:25 +0200)
committerGitHub <noreply@github.com>
Sat, 30 Sep 2023 17:25:54 +0000 (19:25 +0200)
commit74e425ec186dde6bcfb172616fe8f35ccb5a09bb
tree2c9167ef4bc17e11d2ada574f184949a8f53e5bc
parentf3bb00ea12db6525f07d62368a65efec47d192b9
gh-110014: Fix _POSIX_THREADS and _POSIX_SEMAPHORES usage (#110139)

* pycore_pythread.h is now the central place to make sure that
  _POSIX_THREADS and _POSIX_SEMAPHORES macros are defined if
  available.
* Make sure that pycore_pythread.h is included when _POSIX_THREADS
  and _POSIX_SEMAPHORES macros are tested.
* PY_TIMEOUT_MAX is now defined as a constant, since its value
  depends on _POSIX_THREADS, instead of being defined as a macro.
* Prevent integer overflow in the preprocessor when computing
  PY_TIMEOUT_MAX_VALUE on Windows:
  replace "0xFFFFFFFELL * 1000 < LLONG_MAX"
  with "0xFFFFFFFELL < LLONG_MAX / 1000".
* Document the change and give hints how to fix affected code.
* Add an exception for PY_TIMEOUT_MAX  name to smelly.py
* Add PY_TIMEOUT_MAX to the stable ABI
13 files changed:
Doc/data/stable_abi.dat
Doc/whatsnew/3.13.rst
Include/internal/pycore_condvar.h
Include/internal/pycore_pythread.h
Include/internal/pycore_semaphore.h
Include/pythread.h
Lib/test/test_stable_abi_ctypes.py
Misc/stable_abi.toml
PC/python3dll.c
Python/condvar.h
Python/thread.c
Python/thread_pthread.h
Tools/build/smelly.py