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

(cherry picked from commit 5287022eee)

Co-authored-by: David Carlier <dcarlier@afilias.info>
This commit is contained in:
Miss Islington (bot) 2019-06-12 09:03:04 -07:00 committed by GitHub
parent b2fd32b2f0
commit c9ca96dd96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;
}