Skip to content
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

gh-115145: Update documentation about PyThreadState_DeleteCurrent #124920

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Oct 3, 2024

@corona10 corona10 added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Oct 3, 2024
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Oct 3, 2024
@corona10 corona10 removed docs Documentation in the Doc dir awaiting core review labels Oct 3, 2024
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

@vstinner
Copy link
Member

vstinner commented Oct 3, 2024

The GIL must be held, it's checked by:

void
_PyThreadState_DeleteCurrent(PyThreadState *tstate)
{
    _Py_EnsureTstateNotNULL(tstate);
    ...
}

@corona10 corona10 merged commit 9eeb21b into python:main Oct 3, 2024
32 checks passed
@miss-islington-app
Copy link

Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 3, 2024
…rent`` (pythongh-124920)

(cherry picked from commit 9eeb21b)

Co-authored-by: Donghee Na <donghee.na@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 3, 2024
…rent`` (pythongh-124920)

(cherry picked from commit 9eeb21b)

Co-authored-by: Donghee Na <donghee.na@python.org>
@bedevere-app
Copy link

bedevere-app bot commented Oct 3, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 3, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 3, 2024

GH-124931 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 3, 2024
corona10 added a commit that referenced this pull request Oct 3, 2024
…rrent`` (gh-124920) (gh-124931)

gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920)
(cherry picked from commit 9eeb21b)

Co-authored-by: Donghee Na <donghee.na@python.org>
Yhg1s pushed a commit that referenced this pull request Oct 3, 2024
…rrent`` (gh-124920) (#124930)

gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920)
(cherry picked from commit 9eeb21b)

Co-authored-by: Donghee Na <donghee.na@python.org>
@da-woods
Copy link
Contributor

Can we have another look at this?

Like PyThreadState_Delete(), the global interpreter lock must be held.

To me this implies that the GIL must be held for PyThreadState_Delete, which contradicts the documentation for PyThreadState_Delete. I suspect you just want to remove the words "Like PyThreadState_Delete()" but I'm not sure I understand it well enough to be absolutely confident.

@vstinner
Copy link
Member

I agree that "Like PyThreadState_Delete()" is wrong and should be removed.

@corona10: Do you want to propose a patch for this?

@corona10
Copy link
Member Author

Yeah I will send the patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants