◐ Shell
reader mode source ↗
Skip to content

bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait()#28662

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:sem_clockwait
Oct 1, 2021
Merged

bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait()#28662
vstinner merged 3 commits into
python:mainfrom
vstinner:sem_clockwait

Conversation

@vstinner

@vstinner vstinner commented Sep 30, 2021

Copy link
Copy Markdown
Member

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.

https://bugs.python.org/issue41710

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.
@vstinner

Copy link
Copy Markdown
Member Author

@vstinner

Copy link
Copy Markdown
Member Author

@vstinner

vstinner commented Oct 1, 2021

Copy link
Copy Markdown
Member Author

@gpshead @corona10: Thanks for your reviews ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants