mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
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:
parent
d00d942149
commit
55671fe047
5 changed files with 65 additions and 40 deletions
|
|
@ -513,6 +513,7 @@ interp_create(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
|
||||
// Create and initialize the new interpreter.
|
||||
PyThreadState *save_tstate = _PyThreadState_GET();
|
||||
assert(save_tstate != NULL);
|
||||
const PyInterpreterConfig config = isolated
|
||||
? (PyInterpreterConfig)_PyInterpreterConfig_INIT
|
||||
: (PyInterpreterConfig)_PyInterpreterConfig_LEGACY_INIT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue