-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-115035: Mark ThreadHandles as non-joinable earlier after forking #115042
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
This marks dead ThreadHandles as non-joinable earlier in `PyOS_AfterFork_Child()` before we execute any Python code. The handles are stored in a global linked list in `_PyRuntimeState` because `fork()` affects the entire process.
This doesn't call Footnotes |
That's a good point, but then we can probably remove the |
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.
Neat, thank you @colesbury !
Note: you're a core developer now ;-) |
nice refactoring, thanks! happy first-ish merge! |
…king (python#115042) This marks dead ThreadHandles as non-joinable earlier in `PyOS_AfterFork_Child()` before we execute any Python code. The handles are stored in a global linked list in `_PyRuntimeState` because `fork()` affects the entire process.
This marks dead ThreadHandles as non-joinable earlier in
PyOS_AfterFork_Child()
before we execute any Python code. The handles are stored in a global linked list in_PyRuntimeState
becausefork()
affects the entire process.ThreadHandle_dealloc
after fork in free-threaded build #115035