mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-37160: Thread native ID NetBSD support (GH-13835)
This commit is contained in:
parent
32dda263e4
commit
5287022eee
5 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue