diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-13 22:38:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 22:38:08 (GMT) |
commit | 8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 (patch) | |
tree | 3aa66f0f66f706d076cacd4f207039bdca5675bb /Doc/c-api | |
parent | be79373a78c0d75fc715ab64253c9b757987a848 (diff) | |
download | cpython-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.rst | 19 |
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) |