mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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.
This commit is contained in:
parent
addaaaa946
commit
175a704abf
3 changed files with 21 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue