]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39877: _PyRuntimeState.finalizing becomes atomic (GH-18816)
authorVictor Stinner <vstinner@python.org>
Fri, 6 Mar 2020 23:24:23 +0000 (00:24 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Mar 2020 23:24:23 +0000 (00:24 +0100)
commit7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520
tree39b9496171733c94644e7a2671878fc3452526b8
parent557287075c264d2458cd3e1b45e9b8ee5341e0a1
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.
Include/internal/pycore_pystate.h
Python/ceval.c
Python/pylifecycle.c
Python/pystate.c
Python/sysmodule.c