From: Michael Jeanson Date: Wed, 22 Jun 2016 20:23:51 +0000 (-0400) Subject: Fix: Use pthread_self to get threadid on OSX X-Git-Tag: v0.8.10~7 X-Git-Url: http://git.liburcu.org/?p=userspace-rcu.git;a=commitdiff_plain;h=249bf47f2ccfb41991c9417d1e80058695e812f6 Fix: Use pthread_self to get threadid on OSX Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- 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