summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-13 22:38:08 (GMT)
committerGitHub <noreply@github.com>2020-03-13 22:38:08 (GMT)
commit8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 (patch)
tree3aa66f0f66f706d076cacd4f207039bdca5675bb /Doc/c-api
parentbe79373a78c0d75fc715ab64253c9b757987a848 (diff)
downloadcpython-8fb02b6e1942811c8d81041e7df3f5f1f4b1d410.zip
cpython-8fb02b6e1942811c8d81041e7df3f5f1f4b1d410.tar.gz
cpython-8fb02b6e1942811c8d81041e7df3f5f1f4b1d410.tar.bz2
bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981)
Add PyThreadState_GetInterpreter(tstate): get the interpreter of a Python thread state.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/init.rst19
1 files changed, 14 insertions, 5 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 661ed59..f309ad0 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -1064,12 +1064,21 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
:c:func:`PyThreadState_Clear`.
- .. c:function:: void PyThreadState_DeleteCurrent()
+.. c:function:: void PyThreadState_DeleteCurrent(void)
- Destroy the current thread state and release the global interpreter lock.
- Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not
- be held. The thread state must have been reset with a previous call
- to :c:func:`PyThreadState_Clear`.
+ Destroy the current thread state and release the global interpreter lock.
+ Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not
+ be held. The thread state must have been reset with a previous call
+ to :c:func:`PyThreadState_Clear`.
+
+
+.. c:function:: PyInterpreterState* PyThreadState_GetInterpreter(PyThreadState *tstate)
+
+ Get the interpreter of the Python thread state *tstate*.
+
+ *tstate* must not be ``NULL``.
+
+ .. versionadded:: 3.9
.. c:function:: PyInterpreterState* PyInterpreterState_Get(void)