File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
2121PyAPI_FUNC (unsigned long ) PyThread_get_thread_ident (void );
2222
2323#if (defined(__APPLE__ ) || defined(__linux__ ) || defined(_WIN32 ) \
24- || defined(__FreeBSD__ ) || defined(__OpenBSD__ ) || defined(__NetBSD__ ) \
24+ || defined(__FreeBSD__ ) || defined(__FreeBSD_kernel__ ) \
25+ || defined(__OpenBSD__ ) || defined(__NetBSD__ ) \
2526 || defined(__DragonFly__ ) || defined(_AIX ))
2627#define PY_HAVE_THREAD_NATIVE_ID
2728PyAPI_FUNC (unsigned long ) PyThread_get_thread_native_id (void );
Original file line number Diff line number Diff line change 1+ Implement native thread ids for GNU KFreeBSD.
Original file line number Diff line number Diff line change 2020# include <sys/syscall.h> /* syscall(SYS_gettid) */
2121#elif defined(__FreeBSD__ )
2222# include <pthread_np.h> /* pthread_getthreadid_np() */
23+ #elif defined(__FreeBSD_kernel__ )
24+ # include <sys/syscall.h> /* syscall(SYS_thr_self) */
2325#elif defined(__OpenBSD__ )
2426# include <unistd.h> /* getthrid() */
2527#elif defined(_AIX )
@@ -384,6 +386,9 @@ PyThread_get_thread_native_id(void)
384386#elif defined(__FreeBSD__ )
385387 int native_id ;
386388 native_id = pthread_getthreadid_np ();
389+ #elif defined(__FreeBSD_kernel__ )
390+ long native_id ;
391+ syscall (SYS_thr_self , & native_id );
387392#elif defined(__OpenBSD__ )
388393 pid_t native_id ;
389394 native_id = getthrid ();
You can’t perform that action at this time.
0 commit comments