-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-141004: Document missing PyThread* APIs
#141810
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
|
@colesbury, if you have time, I'd really appreciate your expertise here (especially on the |
Co-authored-by: Victor Stinner <[email protected]>
vstinner
left a comment
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.
LGTM
| If *intr_flag* is ``1``, acquiring the lock may be interrupted by a signal, | ||
| in which case this function returns :c:enumerator:`PY_LOCK_INTR`. Upon | ||
| interruption, it's generally expected that the caller makes a call to | ||
| :c:func:`Py_MakePendingCalls` to propagate an exception to Python code. |
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.
PyErr_CheckSignals() may be more appropriate than Py_MakePendingCalls(), no? Currently, it seems like Py_MakePendingCalls() is preferred.
Py_MakePendingCalls() is a superset of PyErr_CheckSignals(), so I'm fine with it.
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.
I think we should use Py_MakePendingCalls, especially considering we use it ourselves in _thread.lock.
|
Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
GH-141954 is a backport of this pull request to the 3.14 branch. |
(cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
GH-141955 is a backport of this pull request to the 3.13 branch. |
…41954) gh-141004: Document missing `PyThread*` APIs (GH-141810) (cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
…41955) * gh-141004: Document missing `PyThread*` APIs (GH-141810) (cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
📚 Documentation preview 📚: https://cpython-previews--141810.org.readthedocs.build/en/141810/c-api/init.html#legacy-locking-apis