summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-24 17:24:01 +0200
committerGitHub <noreply@github.com>2019-04-24 17:24:01 +0200
commit8e91c246e468515b877690e090c73f496552541d (patch)
treed538530b4ac5ccf9aa6dc1e229410b8848eeb4f3 /Python/pystate.c
parent70bf713617e15fad390ed953e48b3c65d9bc90ec (diff)
downloadcpython-git-8e91c246e468515b877690e090c73f496552541d.tar.gz
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()
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 6aaf993cfe..498a9546e1 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -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().