summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-01 11:41:56 (GMT)
committerGitHub <noreply@github.com>2023-06-01 11:41:56 (GMT)
commitec0082ca460f6b5eaf987536d28d6bc252322307 (patch)
tree0eb0150c09e917aa1b37acffa3c6168d625a080a /Doc/c-api/init.rst
parent9ab587b7146618866cee52c220aecf7bd5b44b02 (diff)
downloadcpython-ec0082ca460f6b5eaf987536d28d6bc252322307.zip
cpython-ec0082ca460f6b5eaf987536d28d6bc252322307.tar.gz
cpython-ec0082ca460f6b5eaf987536d28d6bc252322307.tar.bz2
gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)
Remove functions in the C API: * PyEval_AcquireLock() * PyEval_ReleaseLock() * PyEval_InitThreads() * PyEval_ThreadsInitialized() But keep these functions in the stable ABI. Mention "make regen-limited-abi" in "make regen-all".
Diffstat (limited to 'Doc/c-api/init.rst')
-rw-r--r--Doc/c-api/init.rst75
1 files changed, 1 insertions, 74 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index f3690eb..dfb3819 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -59,7 +59,7 @@ The following functions can be safely called before Python is initialized:
:c:func:`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`,
- :c:func:`Py_GetProgramName` and :c:func:`PyEval_InitThreads`.
+ and :c:func:`Py_GetProgramName`.
.. _global-conf-vars:
@@ -326,7 +326,6 @@ Initializing and finalizing the interpreter
.. c:function:: void Py_Initialize()
.. index::
- single: PyEval_InitThreads()
single: modules (in module sys)
single: path (in module sys)
pair: module; builtins
@@ -813,45 +812,6 @@ code, or when embedding the Python interpreter:
this thread's interpreter state.
-.. c:function:: void PyEval_InitThreads()
-
- .. index::
- single: PyEval_AcquireThread()
- single: PyEval_ReleaseThread()
- single: PyEval_SaveThread()
- single: PyEval_RestoreThread()
-
- Deprecated function which does nothing.
-
- In Python 3.6 and older, this function created the GIL if it didn't exist.
-
- .. versionchanged:: 3.9
- The function now does nothing.
-
- .. versionchanged:: 3.7
- This function is now called by :c:func:`Py_Initialize()`, so you don't
- have to call it yourself anymore.
-
- .. versionchanged:: 3.2
- This function cannot be called before :c:func:`Py_Initialize()` anymore.
-
- .. deprecated:: 3.9
-
- .. index:: pair: module; _thread
-
-
-.. c:function:: int PyEval_ThreadsInitialized()
-
- Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. This
- function can be called without holding the GIL, and therefore can be used to
- avoid calls to the locking API when running single-threaded.
-
- .. versionchanged:: 3.7
- The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`.
-
- .. deprecated:: 3.9
-
-
.. c:function:: PyThreadState* PyEval_SaveThread()
Release the global interpreter lock (if it has been created) and reset the
@@ -1223,39 +1183,6 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
available (even when threads have not been initialized).
-.. c:function:: void PyEval_AcquireLock()
-
- Acquire the global interpreter lock. The lock must have been created earlier.
- If this thread already has the lock, a deadlock ensues.
-
- .. deprecated:: 3.2
- This function does not update the current thread state. Please use
- :c:func:`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread`
- instead.
-
- .. note::
- Calling this function from a thread when the runtime is finalizing
- will terminate the thread, even if the thread was not created by Python.
- You can use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to
- check if the interpreter is in process of being finalized before calling
- this function to avoid unwanted termination.
-
- .. versionchanged:: 3.8
- Updated to be consistent with :c:func:`PyEval_RestoreThread`,
- :c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`,
- and terminate the current thread if called while the interpreter is finalizing.
-
-
-.. c:function:: void PyEval_ReleaseLock()
-
- Release the global interpreter lock. The lock must have been created earlier.
-
- .. deprecated:: 3.2
- This function does not update the current thread state. Please use
- :c:func:`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread`
- instead.
-
-
.. _sub-interpreter-support:
Sub-interpreter support