summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-01 07:55:28 (GMT)
committerGitHub <noreply@github.com>2021-10-01 07:55:28 (GMT)
commit1ee0f94d16f150356a4b9b0a39d44ba1d2d5b9fc (patch)
treee94381603c5b5f84731ace512dbc7fbf6bc01fc7 /Misc/NEWS.d/next
parent3e1c5d989a884cfbeb427b6fc86012b03cb95f62 (diff)
downloadcpython-1ee0f94d16f150356a4b9b0a39d44ba1d2d5b9fc.zip
cpython-1ee0f94d16f150356a4b9b0a39d44ba1d2d5b9fc.tar.gz
cpython-1ee0f94d16f150356a4b9b0a39d44ba1d2d5b9fc.tar.bz2
bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28662)
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.
Diffstat (limited to 'Misc/NEWS.d/next')
-rw-r--r--Misc/NEWS.d/next/Library/2021-09-30-23-00-18.bpo-41710.svuloZ.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2021-09-30-23-00-18.bpo-41710.svuloZ.rst b/Misc/NEWS.d/next/Library/2021-09-30-23-00-18.bpo-41710.svuloZ.rst
new file mode 100644
index 0000000..d8a4f95
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-09-30-23-00-18.bpo-41710.svuloZ.rst
@@ -0,0 +1,5 @@
+On Unix, if the ``sem_clockwait()`` function is available in the C library
+(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses the
+monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the timeout, rather than
+using the system clock (:data:`time.CLOCK_REALTIME`), to not be affected by
+system clock changes. Patch by Victor Stinner.