From 09bdef43191a9de4bcc770ad680fa20776a8f683 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 29 Sep 2015 06:38:08 -0400 Subject: [PATCH] Port: Add Solaris support to tests/common/thread-id.h 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 04db5bb..690fdf0 100644 --- a/tests/common/thread-id.h +++ b/tests/common/thread-id.h @@ -50,6 +50,14 @@ unsigned long urcu_get_thread_id(void) { return (unsigned long) pthread_getthreadid_np(); } +#elif defined(__sun__) +#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