Uh oh!
There was an error while loading. Please reload this page.
gh-134745: Change PyThread_allocate_lock() implementation to PyMutex - #134747
Conversation
vstinner
commented
May 26, 2025
This draft PR currently only modify
|
vstinner
commented
May 26, 2025
@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. |
colesbury
commented
May 27, 2025
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Don't call signal handlers if interrupted, only return PY_LOCK_INTR.
colesbury
left a comment
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Sam Gross <colesbury@gmail.com>
vstinner
commented
May 30, 2025
Merged, thanks for the review @colesbury. |
…Mutex (python#134747) Co-authored-by: Sam Gross <colesbury@gmail.com>
…Mutex (python#134747) Co-authored-by: Sam Gross <colesbury@gmail.com>
vstinner
commented
Nov 6, 2025
Oh, I forgot to update |
…Mutex (python#134747) Co-authored-by: Sam Gross <colesbury@gmail.com>
PyMutex is a fast and portable lock currently only used internally by Python. This change modifies
PyThread_allocate_lockto reuse PyMutex.