https://github.com/python/cpython/commit/d786ac7f584f23c3206f4c86032bdabe83c17b51
commit: d786ac7f584f23c3206f4c86032bdabe83c17b51
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2025-01-14T16:31:13+01:00
summary:
gh-59705: Document OS thread name change (#128800)
files:
M Doc/library/threading.rst
M Doc/whatsnew/3.14.rst
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index f183f3f535c4cb..00511df32e4388 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -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()
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index ac203b208f4a8a..9f7ef101e56478 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -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
-------
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]