summaryrefslogtreecommitdiffstats
path: root/Doc/library/threading.rst
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-08-24 22:21:39 (GMT)
committerGitHub <noreply@github.com>2022-08-24 22:21:39 (GMT)
commite34c82abeb7ace09e6b5d116585c47cc372996c1 (patch)
tree16f130870af42de041ddf52a36540b9c421aec8c /Doc/library/threading.rst
parent657976ad950e56b33b7dc15e64a0baecdd184f5a (diff)
downloadcpython-e34c82abeb7ace09e6b5d116585c47cc372996c1.zip
cpython-e34c82abeb7ace09e6b5d116585c47cc372996c1.tar.gz
cpython-e34c82abeb7ace09e6b5d116585c47cc372996c1.tar.bz2
GH-93503: Add thread-specific APIs to set profiling and tracing functions in the C-API (#93504)
* gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
Diffstat (limited to 'Doc/library/threading.rst')
-rw-r--r--Doc/library/threading.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index b22d487..b352125 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -158,6 +158,15 @@ This module defines the following functions:
The *func* will be passed to :func:`sys.settrace` for each thread, before its
:meth:`~Thread.run` method is called.
+.. function:: settrace_all_threads(func)
+
+ Set a trace function for all threads started from the :mod:`threading` module
+ and all Python threads that are currently executing.
+
+ The *func* will be passed to :func:`sys.settrace` for each thread, before its
+ :meth:`~Thread.run` method is called.
+
+ .. versionadded:: 3.12
.. function:: gettrace()
@@ -178,6 +187,15 @@ This module defines the following functions:
The *func* will be passed to :func:`sys.setprofile` for each thread, before its
:meth:`~Thread.run` method is called.
+.. function:: setprofile_all_threads(func)
+
+ Set a profile function for all threads started from the :mod:`threading` module
+ and all Python threads that are currently executing.
+
+ The *func* will be passed to :func:`sys.setprofile` for each thread, before its
+ :meth:`~Thread.run` method is called.
+
+ .. versionadded:: 3.12
.. function:: getprofile()