diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-04-24 15:14:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-24 15:14:33 (GMT) |
commit | b930a2d2b1247bdba560db341ba90a9cbb538eb3 (patch) | |
tree | ed2cd1a40f8150e1c498eca98427c9af4f1c7ada /Modules/posixmodule.c | |
parent | 8bb3230149538c25c1bacced5e64a3c071475f73 (diff) | |
download | cpython-b930a2d2b1247bdba560db341ba90a9cbb538eb3.zip cpython-b930a2d2b1247bdba560db341ba90a9cbb538eb3.tar.gz cpython-b930a2d2b1247bdba560db341ba90a9cbb538eb3.tar.bz2 |
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.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e8dbdcc..56ec3ee 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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); } |