]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-59705: Add _thread.set_name() function (#127338)
authorVictor Stinner <vstinner@python.org>
Fri, 6 Dec 2024 16:27:12 +0000 (17:27 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Dec 2024 16:27:12 +0000 (16:27 +0000)
commit67b18a18b66b89e253f38895057ef9f6bae92e7b
tree86d8e41e6935361b3821b7e2769553ca2123bf0d
parent12680ec5bd45c85b6daebe0739d30ef45f089efa
gh-59705: Add _thread.set_name() function (#127338)

On Linux, threading.Thread now sets the thread name to the operating
system.

* configure now checks if pthread_getname_np()
  and pthread_setname_np() functions are available.
* Add PYTHREAD_NAME_MAXLEN macro.
* Add _thread._NAME_MAXLEN constant for test_threading.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Library/2024-11-27-17-04-38.gh-issue-59705.sAGyvs.rst [new file with mode: 0644]
Modules/_threadmodule.c
Modules/clinic/_threadmodule.c.h [new file with mode: 0644]
configure
configure.ac
pyconfig.h.in