From 249bf47f2ccfb41991c9417d1e80058695e812f6 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 22 Jun 2016 16:23:51 -0400 Subject: [PATCH] Fix: Use pthread_self to get threadid on OSX Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- tests/common/thread-id.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h index 9378edc..14e89b2 100644 --- a/tests/common/thread-id.h +++ b/tests/common/thread-id.h @@ -43,6 +43,14 @@ unsigned long urcu_get_thread_id(void) { return (unsigned long) pthread_getthreadid_np(); } +#elif defined(__sun__) || defined(__APPLE__) +#include + +static inline +unsigned long urcu_get_thread_id(void) +{ + return (unsigned long) pthread_self(); +} #else # warning "use pid as thread ID" static inline -- 2.34.1