bpo-39877: Deprecate PyEval_InitThreads() (GH-18892) · python/cpython@b4698ec (original) (raw)

Original file line number Diff line number Diff line change
@@ -842,12 +842,12 @@ code, or when embedding the Python interpreter:
842 842 single: PyEval_SaveThread()
843 843 single: PyEval_RestoreThread()
844 844
845 - Initialize and acquire the global interpreter lock. It should be called in the
846 - main thread before creating a second thread or engaging in any other thread
847 - operations such as ``PyEval_ReleaseThread(tstate)``. It is not needed before
848 - calling :c:func:`PyEval_SaveThread` or :c:func:`PyEval_RestoreThread`.
845 + Deprecated function which does nothing.
849 846
850 - This is a no-op when called for a second time.
847 + In Python 3.6 and older, this function created the GIL if it didn't exist.
848 +
849 + .. versionchanged:: 3.9
850 + The function now does nothing.
851 851
852 852 .. versionchanged:: 3.7
853 853 This function is now called by :c:func:`Py_Initialize()`, so you don't
@@ -856,6 +856,8 @@ code, or when embedding the Python interpreter:
856 856 .. versionchanged:: 3.2
857 857 This function cannot be called before :c:func:`Py_Initialize()` anymore.
858 858
859 + .. deprecated-removed:: 3.9 3.11
860 +
859 861 .. index:: module: _thread
860 862
861 863
@@ -868,6 +870,8 @@ code, or when embedding the Python interpreter:
868 870 .. versionchanged:: 3.7
869 871 The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`.
870 872
873 + .. deprecated-removed:: 3.9 3.11
874 +
871 875
872 876 .. c:function:: PyThreadState* PyEval_SaveThread()
873 877