]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-146636: abi3t: Define Py_GIL_DISABLED but do not use it (GH-148142)
authorPetr Viktorin <encukou@gmail.com>
Tue, 7 Apr 2026 07:06:17 +0000 (09:06 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2026 07:06:17 +0000 (09:06 +0200)
commitfbc1a5b0761f4331c7070201fefd5b5deb75ebdd
tree5a763dd91be84d89b8465f8a412573f10a081b52
parent5e9d90b615b94469081b39a7b0808fea86c417be
gh-146636: abi3t: Define Py_GIL_DISABLED but do not use it (GH-148142)

When compiling for abi3t, define Py_GIL_DISABLED, so that users who
check it to enable additional locking aren't broken.

But also avoid using Py_GIL_DISABLED in Python headers themselves
-- abi3 and abi3t ought to be the same except
the _Py_OPAQUE_PYOBJECT differences.

A check for this is coming in a later PR.
It will require rewriting some preprocessor conditions, some of these
changes are included in this PR.
For _Py_IsOwnedByCurrentThread & supporting functions
I opted to move them to a cpython/ header, as they're rather self-contained.
Include/cpython/object.h
Include/moduleobject.h
Include/object.h
Include/pyport.h
Include/refcount.h