]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109549: Add new states to PyThreadState to support PEP 703 (gh-109915)
authorSam Gross <colesbury@gmail.com>
Thu, 5 Oct 2023 15:46:33 +0000 (15:46 +0000)
committerGitHub <noreply@github.com>
Thu, 5 Oct 2023 15:46:33 +0000 (09:46 -0600)
commit6e97a9647ae028facb392d12fc24973503693bd6
treecce40bd0d1b8317652405f04c54541d48b3419e9
parent9eb2489266c4c1f115b8f72c0728db737cc8a815
gh-109549: Add new states to PyThreadState to support PEP 703 (gh-109915)

This adds a new field 'state' to PyThreadState that can take on one of three values: _Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, or _Py_THREAD_GC.  The "attached" and "detached" states correspond closely to acquiring and releasing the GIL.  The "gc" state is current unused, but will be used to implement stop-the-world GC for --disable-gil builds in the near future.
Include/cpython/pystate.h
Include/internal/pycore_ceval.h
Include/internal/pycore_pystate.h
Python/ceval_gil.c
Python/pylifecycle.c
Python/pystate.c