summaryrefslogtreecommitdiff
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-10 00:37:48 +0100
committerGitHub <noreply@github.com>2020-03-10 00:37:48 +0100
commit175a704abfcb3400aaeb66d4f098d92ca7e30892 (patch)
tree69632e4e77cf0a397bbe51cdc15d6f0624ef1cf9 /Include/internal
parentaddaaaa946855ad59c8f5c698aa0891d7e44f018 (diff)
downloadcpython-git-175a704abfcb3400aaeb66d4f098d92ca7e30892.tar.gz
bpo-39877: PyGILState_Ensure() don't call PyEval_InitThreads() (GH-18891)
PyGILState_Ensure() doesn't call PyEval_InitThreads() anymore when a new Python thread state is created. The GIL is created by Py_Initialize() since Python 3.7, it's not needed to call PyEval_InitThreads() explicitly. Add an assertion to ensure that the GIL is already created.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_ceval.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index b20e85ccb0..70ce0ee5f7 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -53,6 +53,7 @@ extern PyObject *_PyEval_EvalCode(
PyObject *kwdefs, PyObject *closure,
PyObject *name, PyObject *qualname);
+extern int _PyEval_ThreadsInitialized(_PyRuntimeState *runtime);
extern PyStatus _PyEval_InitThreads(PyThreadState *tstate);
#ifdef __cplusplus