bpo-37160: Thread native ID NetBSD support (GH-13835)

This commit is contained in:
David Carlier 2019-06-12 15:37:56 +00:00 committed by Victor Stinner
parent 32dda263e4
commit 5287022eee
5 changed files with 9 additions and 3 deletions

View file

@ -18,6 +18,8 @@
# include <pthread_np.h> /* pthread_getthreadid_np() */
#elif defined(__OpenBSD__)
# include <unistd.h> /* getthrid() */
#elif defined(__NetBSD__) /* _lwp_self */
# include <lwp.h>
#endif
/* The POSIX spec requires that use of pthread_attr_setstacksize
@ -328,6 +330,9 @@ PyThread_get_thread_native_id(void)
#elif defined(__OpenBSD__)
pid_t native_id;
native_id = getthrid();
#elif defined(__NetBSD__)
lwpid_t native_id;
native_id = _lwp_self();
#endif
return (unsigned long) native_id;
}