diff options
author | Victor Stinner <vstinner@python.org> | 2020-05-05 18:27:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 18:27:47 (GMT) |
commit | 7be4e350aadf93c4be5c97b7291d0db2b6bc1dc4 (patch) | |
tree | 7285b6051ef96253ce4ef2ac2a34412fae9ea281 /Python/pylifecycle.c | |
parent | 0dd5e7a718997da2026ed64fe054dc36cae4fee7 (diff) | |
download | cpython-7be4e350aadf93c4be5c97b7291d0db2b6bc1dc4.zip cpython-7be4e350aadf93c4be5c97b7291d0db2b6bc1dc4.tar.gz cpython-7be4e350aadf93c4be5c97b7291d0db2b6bc1dc4.tar.bz2 |
bpo-40513: Per-interpreter GIL (GH-19943)
In the experimental isolated subinterpreters build mode, the GIL is
now per-interpreter.
Move gil from _PyRuntimeState.ceval to PyInterpreterState.ceval.
new_interpreter() always get the config from the main interpreter.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 2149d89..da66a82 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1561,9 +1561,13 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter) /* Copy the current interpreter config into the new interpreter */ const PyConfig *config; +#ifndef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS if (save_tstate != NULL) { config = _PyInterpreterState_GetConfig(save_tstate->interp); - } else { + } + else +#endif + { /* No current thread state, copy from the main interpreter */ PyInterpreterState *main_interp = PyInterpreterState_Main(); config = _PyInterpreterState_GetConfig(main_interp); |