X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fcommon%2Fthread-id.h;h=56835e3659c8b7b3e59f2aa1d8922ba602a3df90;hp=04db5bb5aa3d25fdc8120d5edc0053e6f6f409d6;hb=b83b3590caf8ddd0fb1393b0d8378f916c8bf831;hpb=6bbcdc421d5614038a1dc8c5645c334372762087 diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h index 04db5bb..56835e3 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__) || 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