]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-59705: Document OS thread name change (#128800)
authorVictor Stinner <vstinner@python.org>
Tue, 14 Jan 2025 15:31:13 +0000 (16:31 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Jan 2025 15:31:13 +0000 (16:31 +0100)
Doc/library/threading.rst
Doc/whatsnew/3.14.rst

index f183f3f535c4cb1ff6b55dbb6aa5a4999090ca28..00511df32e4388817f3ac3bdff2f9e6aa5b299a7 100644 (file)
@@ -380,6 +380,13 @@ since it is impossible to detect the termination of alien threads.
       This method will raise a :exc:`RuntimeError` if called more than once
       on the same thread object.
 
+      If supported, set the operating system thread name to
+      :attr:`threading.Thread.name`. The name can be truncated depending on the
+      operating system thread name limits.
+
+      .. versionchanged:: 3.14
+         Set the operating system thread name.
+
    .. method:: run()
 
       Method representing the thread's activity.
@@ -443,9 +450,6 @@ since it is impossible to detect the termination of alien threads.
       running thread is renamed. (Setting the *name* attribute of a
       different thread only updates the Python Thread object.)
 
-      .. versionchanged:: 3.14
-         Set the operating system thread name.
-
    .. method:: getName()
                setName()
 
index ac203b208f4a8a2aea819d0a32cdeff13960aaa5..9f7ef101e56478eedf97c2fc0c7d2b7d8199c3bf 100644 (file)
@@ -645,6 +645,13 @@ sys.monitoring
 * Two new events are added: :monitoring-event:`BRANCH_LEFT` and
   :monitoring-event:`BRANCH_RIGHT`. The ``BRANCH`` event is deprecated.
 
+threading
+---------
+
+* :meth:`threading.Thread.start` now sets the operating system thread name
+  to :attr:`threading.Thread.name`.
+  (Contributed by Victor Stinner in :gh:`59705`.)
+
 tkinter
 -------