diff options
author | Steve Dower <steve.dower@python.org> | 2022-11-16 17:15:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 17:15:52 (GMT) |
commit | 19c1462e8dca3319c8290e2edcce482bd18cb018 (patch) | |
tree | 01d4d3189f912b0444faf55a44e34057e8dc5afb /Doc/c-api | |
parent | 01fa907aa8e7c475a76b407f35c635b26c9f47f8 (diff) | |
download | cpython-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/c-api')
-rw-r--r-- | Doc/c-api/init.rst | 13 |
1 files changed, 13 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`. |