summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-12 16:03:04 (GMT)
committerGitHub <noreply@github.com>2019-06-12 16:03:04 (GMT)
commitc9ca96dd968176580a011e852066c95a48aab7e0 (patch)
tree4a4388e7de6898df38c46f3ca4a8a96caa8545e1 /Python
parentb2fd32b2f041402bb9fc8607f01566c055aafed9 (diff)
downloadcpython-c9ca96dd968176580a011e852066c95a48aab7e0.zip
cpython-c9ca96dd968176580a011e852066c95a48aab7e0.tar.gz
cpython-c9ca96dd968176580a011e852066c95a48aab7e0.tar.bz2
bpo-37160: Thread native ID NetBSD support (GH-13835)
(cherry picked from commit 5287022eeeb3c017d49fc8580b52e18377bf23f3) Co-authored-by: David Carlier <dcarlier@afilias.info>
Diffstat (limited to 'Python')
-rw-r--r--Python/thread_pthread.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 740b521..9b4b23b 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -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;
}