Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensityZeroIntensity commented Nov 20, 2025

@ZeroIntensity
Copy link
MemberAuthor

ZeroIntensity commented Nov 20, 2025

@colesbury, if you have time, I'd really appreciate your expertise here (especially on the PyThread_exit_thread warning).

ZeroIntensityand others added 2 commits November 21, 2025 08:42
Co-authored-by: Victor Stinner <vstinner@python.org>
Copy link
Member

@vstinnervstinner left a 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.
Copy link
Member

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.

Copy link
MemberAuthor

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.

@ZeroIntensityZeroIntensity merged commit a89ee4b into python:mainNov 25, 2025
32 checks passed
@ZeroIntensityZeroIntensity deleted the document-pythread branch November 25, 2025 17:53
@github-project-automationgithub-project-automationbot moved this from Todo to Done in Docs PRsNov 25, 2025
@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 25, 2025
(cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

GH-141954 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14 bugs and security fixes label Nov 25, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 25, 2025
(cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

GH-141955 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Nov 25, 2025
ZeroIntensity added a commit that referenced this pull request Nov 25, 2025
…41954) gh-141004: Document missing `PyThread*` APIs (GH-141810) (cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
ZeroIntensity added a commit that referenced this pull request Nov 25, 2025
…41955) * gh-141004: Document missing `PyThread*` APIs (GH-141810) (cherry picked from commit a89ee4b) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Co-authored-by: Victor Stinner <vstinner@python.org>
ashm-dev pushed a commit to ashm-dev/cpython that referenced this pull request Dec 8, 2025
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

@ZeroIntensity@vstinner@colesbury