[3.9] bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28671) by miss-islington · Pull Request #28683 · python/cpython
On Unix, if the sem_clockwait() function is available in the C
library (glibc 2.30 and newer), the threading.Lock.acquire() method
now uses the monotonic clock (time.CLOCK_MONOTONIC) for the timeout,
rather than using the system clock (time.CLOCK_REALTIME), to not be
affected by system clock changes.
configure now checks if the sem_clockwait() function is available.
(cherry picked from commit 6df8c32)
Co-authored-by: Victor Stinner vstinner@python.org