@@ -59,7 +59,7 @@ The following functions can be safely called before Python is initialized:
5959 :c:func: `Py_Initialize `: :c:func: `Py_EncodeLocale `, :c:func: `Py_GetPath `,
6060 :c:func: `Py_GetPrefix `, :c:func: `Py_GetExecPrefix `,
6161 :c:func: `Py_GetProgramFullPath `, :c:func: `Py_GetPythonHome `,
62- and :c:func: `Py_GetProgramName `.
62+ :c:func: ` Py_GetProgramName ` and :c:func: `PyEval_InitThreads `.
6363
6464
6565.. _global-conf-vars :
@@ -326,6 +326,7 @@ Initializing and finalizing the interpreter
326326.. c :function :: void Py_Initialize ()
327327
328328 .. index::
329+ single: PyEval_InitThreads()
329330 single: modules (in module sys)
330331 single: path (in module sys)
331332 pair: module; builtins
@@ -841,6 +842,33 @@ code, or when embedding the Python interpreter:
841842 This thread's interpreter state.
842843
843844
845+ .. c:function:: void PyEval_InitThreads()
846+
847+ .. index::
848+ single: PyEval_AcquireThread()
849+ single: PyEval_ReleaseThread()
850+ single: PyEval_SaveThread()
851+ single: PyEval_RestoreThread()
852+
853+ Deprecated function which does nothing.
854+
855+ In Python 3.6 and older, this function created the GIL if it didn't exist.
856+
857+ .. versionchanged:: 3.9
858+ The function now does nothing.
859+
860+ .. versionchanged:: 3.7
861+ This function is now called by :c:func:`Py_Initialize()`, so you don't
862+ have to call it yourself anymore.
863+
864+ .. versionchanged:: 3.2
865+ This function cannot be called before :c:func:`Py_Initialize()` anymore.
866+
867+ .. deprecated:: 3.9
868+
869+ .. index:: pair: module; _thread
870+
871+
844872.. c:function:: PyThreadState* PyEval_SaveThread()
845873
846874 Release the global interpreter lock (if it has been created) and reset the
0 commit comments