gh-128279: Enhance the NetBSD compatibility for thread naming (#128280)
Enhance NetBSD compatibility for thread naming in _threadmodule.c.
This commit is contained in:
parent
2cf396c368
commit
492b224b99
@ -2438,6 +2438,9 @@ _thread_set_name_impl(PyObject *module, PyObject *name_obj)
|
||||
const char *name = PyBytes_AS_STRING(name_encoded);
|
||||
#ifdef __APPLE__
|
||||
int rc = pthread_setname_np(name);
|
||||
#elif defined(__NetBSD__)
|
||||
pthread_t thread = pthread_self();
|
||||
int rc = pthread_setname_np(thread, "%s", (void *)name);
|
||||
#else
|
||||
pthread_t thread = pthread_self();
|
||||
int rc = pthread_setname_np(thread, name);
|
||||
|
1
configure
generated
vendored
1
configure
generated
vendored
@ -29148,6 +29148,7 @@ CPPFLAGS=$save_CPPFLAGS
|
||||
case "$ac_sys_system" in
|
||||
Linux*) PYTHREAD_NAME_MAXLEN=15;; # Linux and Android
|
||||
SunOS*) PYTHREAD_NAME_MAXLEN=31;;
|
||||
NetBSD*) PYTHREAD_NAME_MAXLEN=31;;
|
||||
Darwin) PYTHREAD_NAME_MAXLEN=63;;
|
||||
iOS) PYTHREAD_NAME_MAXLEN=63;;
|
||||
FreeBSD*) PYTHREAD_NAME_MAXLEN=98;;
|
||||
|
@ -7514,6 +7514,7 @@ _RESTORE_VAR([CPPFLAGS])
|
||||
case "$ac_sys_system" in
|
||||
Linux*) PYTHREAD_NAME_MAXLEN=15;; # Linux and Android
|
||||
SunOS*) PYTHREAD_NAME_MAXLEN=31;;
|
||||
NetBSD*) PYTHREAD_NAME_MAXLEN=31;;
|
||||
Darwin) PYTHREAD_NAME_MAXLEN=63;;
|
||||
iOS) PYTHREAD_NAME_MAXLEN=63;;
|
||||
FreeBSD*) PYTHREAD_NAME_MAXLEN=98;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user