mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-36710: PyOS_AfterFork_Child() pass runtime parameter (GH-12936)
The PyOS_AfterFork_Child() function now pass a 'runtime' parameter to subfunctions. * Fix _PyRuntimeState_ReInitThreads(): use the correct memory allocator * Add runtime parameter to _PyRuntimeState_ReInitThreads(), _PyGILState_Reinit() and _PyInterpreterState_DeleteExceptMain() * Move _PyGILState_Reinit() to the internal C API.
This commit is contained in:
parent
8bb3230149
commit
b930a2d2b1
4 changed files with 43 additions and 42 deletions
|
@ -421,12 +421,13 @@ PyOS_AfterFork_Parent(void)
|
|||
void
|
||||
PyOS_AfterFork_Child(void)
|
||||
{
|
||||
_PyGILState_Reinit();
|
||||
_PyInterpreterState_DeleteExceptMain();
|
||||
_PyRuntimeState *runtime = &_PyRuntime;
|
||||
_PyGILState_Reinit(runtime);
|
||||
_PyInterpreterState_DeleteExceptMain(runtime);
|
||||
PyEval_ReInitThreads();
|
||||
_PyImport_ReInitLock();
|
||||
_PySignal_AfterFork();
|
||||
_PyRuntimeState_ReInitThreads();
|
||||
_PyRuntimeState_ReInitThreads(runtime);
|
||||
|
||||
run_at_forkers(_PyInterpreterState_Get()->after_forkers_child, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue