mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-37031: Fix PyOS_AfterFork_Child() (GH-13537)
PyOS_AfterFork_Child(): _PyInterpreterState_DeleteExceptMain() must be called after _PyRuntimeState_ReInitThreads(). _PyRuntimeState_ReInitThreads() resets interpreters mutex after fork, mutex used by _PyInterpreterState_DeleteExceptMain().
This commit is contained in:
parent
b3a9843cd1
commit
b49858b4b7
1 changed files with 1 additions and 1 deletions
|
@ -448,11 +448,11 @@ PyOS_AfterFork_Child(void)
|
|||
{
|
||||
_PyRuntimeState *runtime = &_PyRuntime;
|
||||
_PyGILState_Reinit(runtime);
|
||||
_PyInterpreterState_DeleteExceptMain(runtime);
|
||||
_PyEval_ReInitThreads(runtime);
|
||||
_PyImport_ReInitLock();
|
||||
_PySignal_AfterFork();
|
||||
_PyRuntimeState_ReInitThreads(runtime);
|
||||
_PyInterpreterState_DeleteExceptMain(runtime);
|
||||
|
||||
run_at_forkers(_PyInterpreterState_Get()->after_forkers_child, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue