gh-99113: Share the GIL via PyInterpreterState.ceval.gil (gh-104203)

In preparation for a per-interpreter GIL, we add PyInterpreterState.ceval.gil, set it to the shared GIL for each interpreter, and use that rather than using _PyRuntime.ceval.gil directly.  Note that _PyRuntime.ceval.gil is still the actual GIL.
This commit is contained in:
Eric Snow 2023-05-05 13:23:00 -06:00 committed by GitHub
parent d00d942149
commit 55671fe047
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 40 deletions

View file

@ -2186,7 +2186,7 @@ PyGILState_Ensure(void)
/* Ensure that _PyEval_InitThreads() and _PyGILState_Init() have been
called by Py_Initialize() */
assert(_PyEval_ThreadsInitialized(runtime));
assert(_PyEval_ThreadsInitialized());
assert(gilstate_tss_initialized(runtime));
assert(runtime->gilstate.autoInterpreterState != NULL);