]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-59956: Clarify GILState-related Code (gh-101161)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 19 Jan 2023 23:04:14 +0000 (16:04 -0700)
committerGitHub <noreply@github.com>
Thu, 19 Jan 2023 23:04:14 +0000 (16:04 -0700)
commit6036c3e856f033bf13e929536e7bf127fdd921c9
tree2e0f92c60f4d860826e6e224e6c073e220d76386
parent8a2d4f4e8eea86352de37d2ce28117e13b3dfaed
gh-59956: Clarify GILState-related Code (gh-101161)

The objective of this change is to help make the GILState-related code easier to understand.  This mostly involves moving code around and some semantically equivalent refactors.  However, there are a also a small number of slight changes in structure and behavior:

* tstate_current is moved out of _PyRuntimeState.gilstate
* autoTSSkey is moved out of _PyRuntimeState.gilstate
* autoTSSkey is initialized earlier
* autoTSSkey is re-initialized (after fork) earlier

https://github.com/python/cpython/issues/59956
Include/cpython/pystate.h
Include/internal/pycore_pylifecycle.h
Include/internal/pycore_pystate.h
Include/internal/pycore_runtime.h
Include/internal/pycore_runtime_init.h
Modules/_threadmodule.c
Modules/posixmodule.c
Python/ceval_gil.c
Python/pylifecycle.c
Python/pystate.c