Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-108724: Fix _PySemaphore_Wait call during thread deletion#116483

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
colesbury merged 3 commits intopython:mainfromcolesbury:gh-108724-sema-wait
Mar 8, 2024

Conversation

colesbury
Copy link
Contributor

@colesburycolesbury commentedMar 7, 2024
edited by bedevere-appbot
Loading

In general, when_PyThreadState_GET() is non-NULL then the current thread is "attached", but there is a small window duringPyThreadState_DeleteCurrent() where that's not true:tstate_delete_common() is called when the thread is detached, but before current_fast_clear().

This updates_PySemaphore_Wait() to handle that case.

In general, when `_PyThreadState_GET()` is non-NULL then the currentthread is "attached", but there is a small window during`PyThreadState_DeleteCurrent()` where that's not true:tstate_delete_common is called when the thread is detached, but beforecurrent_fast_clear().This updates _PySemaphore_Wait() to handle that case.
@colesburycolesbury changed the titlegh-116480: Fix _PySemaphore_Wait call during thread deletiongh-108724: Fix _PySemaphore_Wait call during thread deletionMar 7, 2024
Copy link
Member

@ericsnowcurrentlyericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

I have one very minor comment about the applicability of thePyEval_ReleaseThread() call. Feel free to address it (or not) how you think makes sense.

As to the motivation for this PR, should we aim for eliminating the small window you described in PR description? It vaguely feels like something is our of whack with that.

colesburyand others added2 commitsMarch 8, 2024 14:52
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
@colesbury
Copy link
ContributorAuthor

As to the motivation for this PR, should we aim for eliminating the small window you described in PR description? It vaguely feels like something is our of whack with that.

Yeah, I'll put up another PR that does that as well.

ericsnowcurrently reacted with thumbs up emoji

@colesburycolesbury merged commit3cdfdc0 intopython:mainMar 8, 2024
@colesburycolesbury deleted the gh-108724-sema-wait branchMarch 8, 2024 20:26
adorilson pushed a commit to adorilson/cpython that referenced this pull requestMar 25, 2024
…ython#116483)In general, when `_PyThreadState_GET()` is non-NULL then the currentthread is "attached", but there is a small window during`PyThreadState_DeleteCurrent()` where that's not true:tstate_delete_common() is called when the thread is detached, but beforecurrent_fast_clear().Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull requestApr 17, 2024
…ython#116483)In general, when `_PyThreadState_GET()` is non-NULL then the currentthread is "attached", but there is a small window during`PyThreadState_DeleteCurrent()` where that's not true:tstate_delete_common() is called when the thread is detached, but beforecurrent_fast_clear().Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ericsnowcurrentlyericsnowcurrentlyericsnowcurrently approved these changes

@DinoVDinoVAwaiting requested review from DinoV

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@colesbury@ericsnowcurrently

[8]ページ先頭

©2009-2025 Movatter.jp