gh-146636: abi3t: Define Py_GIL_DISABLED but do not to use it#148142
gh-146636: abi3t: Define Py_GIL_DISABLED but do not to use it#148142encukou merged 2 commits intopython:mainfrom
Conversation
…se it When compiling for abi3t, define Py_GIL_DISABLED, so that users who check it to enable additional locking aren't broken. But also add a test that Python headers themselves don't use Py_GIL_DISABLED -- abi3 and abi3t ought to be the same except the _Py_OPAQUE_PYOBJECT differences. This is done using the GCC-only poison pragma. This did require rewriting some preprocessor conditions, and moving _Py_IsOwnedByCurrentThread & supporting functions to a cpython/ header.
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit cb3c6fe 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148142%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit 1cd72a7 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148142%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Some paths still use |
|
When compiling for abi3t, define
Py_GIL_DISABLED, so that users who check it to enable additional locking aren't broken.But also add a test that Python headers themselves don't use
Py_GIL_DISABLED, sinceabi3andabi3tought to be the same except the_Py_OPAQUE_PYOBJECTdifferences.This is done using the GCC-only
poisonpragma, which tells the compiler/preprocessor to error if it ever sees the identifier after thepragma.This did require rewriting some preprocessor conditions --
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)needs to be split into two lines, as the poisoning doesn't honour short-circuiting.For
_Py_IsOwnedByCurrentThread& supporting functions I opted to move them to acpython/header, as they're rather self-contained.