summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-05-19 22:27:46 (GMT)
committerGitHub <noreply@github.com>2020-05-19 22:27:46 (GMT)
commit9512ad74b0fcaff023c1ade75313dc8e249aef78 (patch)
treed8a0949f5e3cea7910a33b8ec7d723804e21d8dd /Python/ceval.c
parentb008445a7b93c8c5d4773d33277c6fe815afca7b (diff)
downloadcpython-9512ad74b0fcaff023c1ade75313dc8e249aef78.zip
cpython-9512ad74b0fcaff023c1ade75313dc8e249aef78.tar.gz
cpython-9512ad74b0fcaff023c1ade75313dc8e249aef78.tar.bz2
[3.9] bpo-40514: Remove --with-experimental-isolated-subinterpreters in 3.9 (GH-20228)
Remove --with-experimental-isolated-subinterpreters configure option in Python 3.9: the experiment continues in the master branch, but it's no longer needed in 3.9.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 43ea1c7..ff67c83 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -250,21 +250,6 @@ ensure_tstate_not_null(const char *func, PyThreadState *tstate)
}
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
-int
-_PyEval_ThreadsInitialized(PyInterpreterState *interp)
-{
- return gil_created(&interp->ceval.gil);
-}
-
-int
-PyEval_ThreadsInitialized(void)
-{
- // Fatal error if there is no current interpreter
- PyInterpreterState *interp = PyInterpreterState_Get();
- return _PyEval_ThreadsInitialized(interp);
-}
-#else
int
_PyEval_ThreadsInitialized(_PyRuntimeState *runtime)
{
@@ -277,25 +262,18 @@ PyEval_ThreadsInitialized(void)
_PyRuntimeState *runtime = &_PyRuntime;
return _PyEval_ThreadsInitialized(runtime);
}
-#endif
PyStatus
_PyEval_InitGIL(PyThreadState *tstate)
{
-#ifndef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
if (!_Py_IsMainInterpreter(tstate)) {
/* Currently, the GIL is shared by all interpreters,
and only the main interpreter is responsible to create
and destroy it. */
return _PyStatus_OK();
}
-#endif
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- struct _gil_runtime_state *gil = &tstate->interp->ceval.gil;
-#else
struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil;
-#endif
assert(!gil_created(gil));
PyThread_init_thread();
@@ -310,20 +288,14 @@ _PyEval_InitGIL(PyThreadState *tstate)
void
_PyEval_FiniGIL(PyThreadState *tstate)
{
-#ifndef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
if (!_Py_IsMainInterpreter(tstate)) {
/* Currently, the GIL is shared by all interpreters,
and only the main interpreter is responsible to create
and destroy it. */
return;
}
-#endif
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- struct _gil_runtime_state *gil = &tstate->interp->ceval.gil;
-#else
struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil;
-#endif
if (!gil_created(gil)) {
/* First Py_InitializeFromConfig() call: the GIL doesn't exist
yet: do nothing. */
@@ -408,13 +380,9 @@ PyEval_AcquireThread(PyThreadState *tstate)
take_gil(tstate);
struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate;
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- (void)_PyThreadState_Swap(gilstate, tstate);
-#else
if (_PyThreadState_Swap(gilstate, tstate) != NULL) {
Py_FatalError("non-NULL old thread state");
}
-#endif
}
void
@@ -444,11 +412,7 @@ _PyEval_ReInitThreads(_PyRuntimeState *runtime)
PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
ensure_tstate_not_null(__func__, tstate);
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- struct _gil_runtime_state *gil = &tstate->interp->ceval.gil;
-#else
struct _gil_runtime_state *gil = &runtime->ceval.gil;
-#endif
if (!gil_created(gil)) {
return;
}
@@ -480,21 +444,12 @@ PyThreadState *
PyEval_SaveThread(void)
{
_PyRuntimeState *runtime = &_PyRuntime;
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- PyThreadState *old_tstate = _PyThreadState_GET();
- PyThreadState *tstate = _PyThreadState_Swap(&runtime->gilstate, old_tstate);
-#else
PyThreadState *tstate = _PyThreadState_Swap(&runtime->gilstate, NULL);
-#endif
ensure_tstate_not_null(__func__, tstate);
struct _ceval_runtime_state *ceval = &runtime->ceval;
struct _ceval_state *ceval2 = &tstate->interp->ceval;
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- assert(gil_created(&ceval2->gil));
-#else
assert(gil_created(&ceval->gil));
-#endif
drop_gil(ceval, ceval2, tstate);
return tstate;
}
@@ -753,9 +708,7 @@ void
_PyEval_InitRuntimeState(struct _ceval_runtime_state *ceval)
{
_Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT;
-#ifndef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
_gil_initialize(&ceval->gil);
-#endif
}
int
@@ -771,10 +724,6 @@ _PyEval_InitState(struct _ceval_state *ceval)
return -1;
}
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- _gil_initialize(&ceval->gil);
-#endif
-
return 0;
}
@@ -919,13 +868,9 @@ eval_frame_handle_pending(PyThreadState *tstate)
take_gil(tstate);
-#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
- (void)_PyThreadState_Swap(&runtime->gilstate, tstate);
-#else
if (_PyThreadState_Swap(&runtime->gilstate, tstate) != NULL) {
Py_FatalError("orphan tstate");
}
-#endif
}
/* Check for asynchronous exception. */