summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-11-16 17:15:52 (GMT)
committerGitHub <noreply@github.com>2022-11-16 17:15:52 (GMT)
commit19c1462e8dca3319c8290e2edcce482bd18cb018 (patch)
tree01d4d3189f912b0444faf55a44e34057e8dc5afb /Doc
parent01fa907aa8e7c475a76b407f35c635b26c9f47f8 (diff)
downloadcpython-19c1462e8dca3319c8290e2edcce482bd18cb018.zip
cpython-19c1462e8dca3319c8290e2edcce482bd18cb018.tar.gz
cpython-19c1462e8dca3319c8290e2edcce482bd18cb018.tar.bz2
gh-99377: Add audit events for thread creation and clear (GH-99378)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/init.rst13
-rw-r--r--Doc/library/_thread.rst2
2 files changed, 15 insertions, 0 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index afb1771..273838c 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -1239,12 +1239,25 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
The global interpreter lock need not be held, but may be held if it is
necessary to serialize calls to this function.
+ .. audit-event:: cpython.PyThreadState_New id c.PyThreadState_New
+
+ Raise an auditing event ``cpython.PyThreadState_New`` with Python's thread
+ id as the argument. The event will be raised from the thread creating the new
+ ``PyThreadState``, which may not be the new thread.
+
.. c:function:: void PyThreadState_Clear(PyThreadState *tstate)
Reset all information in a thread state object. The global interpreter lock
must be held.
+ .. audit-event:: cpython.PyThreadState_Clear id c.PyThreadState_Clear
+
+ Raise an auditing event ``cpython.PyThreadState_Clear`` with Python's
+ thread id as the argument. The event may be raised from a different thread
+ than the one being cleared. Exceptions raised from a hook will be treated
+ as unraisable and will not abort the operation.
+
.. versionchanged:: 3.9
This function now calls the :c:member:`PyThreadState.on_delete` callback.
Previously, that happened in :c:func:`PyThreadState_Delete`.
diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst
index 9df9e79..122692a 100644
--- a/Doc/library/_thread.rst
+++ b/Doc/library/_thread.rst
@@ -57,6 +57,8 @@ This module defines the following constants and functions:
When the function raises a :exc:`SystemExit` exception, it is silently
ignored.
+ .. audit-event:: _thread.start_new_thread function,args,kwargs start_new_thread
+
.. versionchanged:: 3.8
:func:`sys.unraisablehook` is now used to handle unhandled exceptions.