-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-134745: Change PyThread_allocate_lock() implementation to PyMutex #134747
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
Conversation
This draft PR currently only modify
|
@colesbury: What do you think of this idea? Does it make sense? Do you see any possible issue? If the approach makes sense, I will update my PR to modify also the Windows implementation. |
I think the idea is fine, but the PR title and description are confusing. cpython/Modules/_threadmodule.c Lines 757 to 760 in f6f4e8a
This PR changes the implementation of the C API I think it's okay to change the implementation of |
Don't call signal handlers if interrupted, only return PY_LOCK_INTR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but I think you should include a NEWS entry. One behavioral change is that previously intr_flag
was ignored on Windows, but now it actually makes the acquisitions interruptible.
Co-authored-by: Sam Gross <[email protected]>
Merged, thanks for the review @colesbury. |
PyMutex is a fast and portable lock currently only used internally by Python. This change modifies
PyThread_allocate_lock
to reuse PyMutex.