mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
71239d50b5
commit
b6228b521b
7 changed files with 50 additions and 41 deletions
|
@ -16,6 +16,7 @@ extern "C" {
|
|||
#include "pycore_parser.h" // _parser_runtime_state_INIT
|
||||
#include "pycore_pyhash.h" // pyhash_state_INIT
|
||||
#include "pycore_pymem_init.h" // _pymem_allocators_standard_INIT
|
||||
#include "pycore_pythread.h" // _pythread_RUNTIME_INIT
|
||||
#include "pycore_runtime_init_generated.h" // _Py_bytes_characters_INIT
|
||||
#include "pycore_signal.h" // _signals_RUNTIME_INIT
|
||||
#include "pycore_tracemalloc.h" // _tracemalloc_runtime_state_INIT
|
||||
|
@ -90,6 +91,7 @@ extern PyTypeObject _PyExc_MemoryError;
|
|||
}, \
|
||||
.obmalloc = _obmalloc_global_state_INIT, \
|
||||
.pyhash_state = pyhash_state_INIT, \
|
||||
.threads = _pythread_RUNTIME_INIT(runtime.threads), \
|
||||
.signals = _signals_RUNTIME_INIT, \
|
||||
.interpreters = { \
|
||||
/* This prevents interpreters from getting created \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue