mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-37087: Adding native ID support for OpenBSD (GH-13654)
This commit is contained in:
parent
141da44bb4
commit
0b9956e916
5 changed files with 10 additions and 4 deletions
|
@ -16,6 +16,8 @@
|
|||
# include <sys/syscall.h> /* syscall(SYS_gettid) */
|
||||
#elif defined(__FreeBSD__)
|
||||
# include <pthread_np.h> /* pthread_getthreadid_np() */
|
||||
#elif defined(__OpenBSD__)
|
||||
# include <unistd.h> /* getthrid() */
|
||||
#endif
|
||||
|
||||
/* The POSIX spec requires that use of pthread_attr_setstacksize
|
||||
|
@ -323,6 +325,9 @@ PyThread_get_thread_native_id(void)
|
|||
#elif defined(__FreeBSD__)
|
||||
int native_id;
|
||||
native_id = pthread_getthreadid_np();
|
||||
#elif defined(__OpenBSD__)
|
||||
pid_t native_id;
|
||||
native_id = getthrid();
|
||||
#endif
|
||||
return (unsigned long) native_id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue