From 0b9956e9162d8723c2a30ff316ecc25e54459fb1 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 3 Jun 2019 16:43:33 +0100 Subject: bpo-37087: Adding native ID support for OpenBSD (GH-13654) --- Python/thread_pthread.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python/thread_pthread.h') diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index f57a1e7bb7..740b521b94 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -16,6 +16,8 @@ # include /* syscall(SYS_gettid) */ #elif defined(__FreeBSD__) # include /* pthread_getthreadid_np() */ +#elif defined(__OpenBSD__) +# include /* 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; } -- cgit v1.2.1