summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-25 20:23:53 (GMT)
committerGitHub <noreply@github.com>2020-03-25 20:23:53 (GMT)
commit5c3cda0d1a850a1a9b43892f48376b8876bd5863 (patch)
tree723a2cb38dfec21de9cabe70d2bc952986788f5f /Doc
parent0e427c6d159e86f17270770cd8dc37372e3c4004 (diff)
downloadcpython-5c3cda0d1a850a1a9b43892f48376b8876bd5863.zip
cpython-5c3cda0d1a850a1a9b43892f48376b8876bd5863.tar.gz
cpython-5c3cda0d1a850a1a9b43892f48376b8876bd5863.tar.bz2
bpo-39947: Add PyThreadState_GetID() function (GH-19163)
Add PyThreadState_GetID() function: get the unique identifier of a Python thread state.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/init.rst9
-rw-r--r--Doc/whatsnew/3.9.rst2
2 files changed, 11 insertions, 0 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 294c1b9..f78ab99 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -1084,6 +1084,15 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
.. versionadded:: 3.9
+.. c:function:: uint64_t PyThreadState_GetID(PyThreadState *tstate)
+
+ Get the unique thread state identifier of the Python thread state *tstate*.
+
+ *tstate* must not be ``NULL``.
+
+ .. versionadded:: 3.9
+
+
.. c:function:: PyInterpreterState* PyThreadState_GetInterpreter(PyThreadState *tstate)
Get the interpreter of the Python thread state *tstate*.
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index b11c29b..778e443 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -429,6 +429,8 @@ Build and C API Changes
:c:func:`PyInterpreterState_Get` functions to get the interpreter.
New :c:func:`PyThreadState_GetFrame` function to get the current frame of a
Python thread state.
+ New :c:func:`PyThreadState_GetID` function: get the unique identifier of a
+ Python thread state.
(Contributed by Victor Stinner in :issue:`39947`.)
* Add ``--with-platlibdir`` option to the ``configure`` script: name of the