mirror of
https://github.com/python/cpython.git
synced 2025-09-02 15:07:53 +00:00
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.
This commit is contained in:
parent
0dd5e7a718
commit
7be4e350aa
6 changed files with 82 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue