gh-115035: Mark ThreadHandles as non-joinable earlier after forking (#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 commit is contained in:
Sam Gross 2024-02-06 14:45:04 -05:00 committed by GitHub
parent 71239d50b5
commit b6228b521b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 41 deletions

View file

@ -517,6 +517,8 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime)
return _PyStatus_NO_MEMORY();
}
_PyThread_AfterFork(&runtime->threads);
return _PyStatus_OK();
}
#endif