summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-06 23:24:23 (GMT)
committerGitHub <noreply@github.com>2020-03-06 23:24:23 (GMT)
commit7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520 (patch)
tree39b9496171733c94644e7a2671878fc3452526b8 /Python/pystate.c
parent557287075c264d2458cd3e1b45e9b8ee5341e0a1 (diff)
downloadcpython-7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520.zip
cpython-7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520.tar.gz
cpython-7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520.tar.bz2
bpo-39877: _PyRuntimeState.finalizing becomes atomic (GH-18816)
Convert _PyRuntimeState.finalizing field to an atomic variable: * Rename it to _finalizing * Change its type to _Py_atomic_address * Add _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing() functions * Remove _Py_CURRENTLY_FINALIZING() function: replace it with testing directly _PyRuntimeState_GetFinalizing() value Convert _PyRuntimeState_GetThreadState() to static inline function.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 4001c63..9002669 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -292,7 +292,7 @@ PyInterpreterState_Clear(PyInterpreterState *interp)
Py_CLEAR(interp->after_forkers_parent);
Py_CLEAR(interp->after_forkers_child);
#endif
- if (runtime->finalizing == NULL) {
+ if (_PyRuntimeState_GetFinalizing(runtime) == NULL) {
_PyWarnings_Fini(interp);
}
// XXX Once we have one allocator per interpreter (i.e.