bpo-36710: Add runtime variable to Py_FinalizeEx() (GH-12937)

* Add a 'runtime' variable to Py_FinalizeEx() rather than working
  directly on the global variable _PyRuntime
* Add a 'runtime' parameter to _PyGC_Fini(), _PyGILState_Fini()
  and call_ll_exitfuncs()
This commit is contained in:
Victor Stinner 2019-04-24 17:24:01 +02:00 committed by GitHub
parent 70bf713617
commit 8e91c246e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 24 deletions

View file

@ -1078,10 +1078,11 @@ _PyGILState_GetInterpreterStateUnsafe(void)
}
void
_PyGILState_Fini(void)
_PyGILState_Fini(_PyRuntimeState *runtime)
{
PyThread_tss_delete(&_PyRuntime.gilstate.autoTSSkey);
_PyRuntime.gilstate.autoInterpreterState = NULL;
struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
PyThread_tss_delete(&gilstate->autoTSSkey);
gilstate->autoInterpreterState = NULL;
}
/* Reset the TSS key - called by PyOS_AfterFork_Child().