@@ -59,7 +59,7 @@ The following functions can be safely called before Python is initialized:
59
59
:c:func: `Py_Initialize `: :c:func: `Py_EncodeLocale `, :c:func: `Py_GetPath `,
60
60
:c:func: `Py_GetPrefix `, :c:func: `Py_GetExecPrefix `,
61
61
:c:func: `Py_GetProgramFullPath `, :c:func: `Py_GetPythonHome `,
62
- and :c:func: `Py_GetProgramName `.
62
+ :c:func: ` Py_GetProgramName ` and :c:func: `PyEval_InitThreads `.
63
63
64
64
65
65
.. _global-conf-vars :
@@ -326,6 +326,7 @@ Initializing and finalizing the interpreter
326
326
.. c :function :: void Py_Initialize ()
327
327
328
328
.. index::
329
+ single: PyEval_InitThreads()
329
330
single: modules (in module sys)
330
331
single: path (in module sys)
331
332
pair: module; builtins
@@ -841,6 +842,33 @@ code, or when embedding the Python interpreter:
841
842
This thread's interpreter state.
842
843
843
844
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
+
844
872
.. c:function:: PyThreadState* PyEval_SaveThread()
845
873
846
874
Release the global interpreter lock (if it has been created) and reset the
0 commit comments