Skip to content

[3.9] bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28671) #28683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 1, 2021

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 [email protected]

https://bugs.python.org/issue41710

…GH-28671)

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 <[email protected]>
@miss-islington
Copy link
Contributor Author

@vstinner: Status check is done, and it's a success ✅ .

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good bot.

@vstinner vstinner merged commit 0e1aeab into python:3.9 Oct 1, 2021
@miss-islington miss-islington deleted the backport-6df8c32-3.9 branch October 1, 2021 16:51
@miss-islington
Copy link
Contributor Author

@vstinner: Status check is done, and it's a success ✅ .

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.

4 participants