X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fcommon%2Fthread-id.h;fp=tests%2Fcommon%2Fthread-id.h;h=1e533966895aa1e747f45b38ed52fd123852ca52;hp=cb0d903748b1d0ddf2fd6b7c8a219d10f917896c;hb=11f3d1c24e6179abf8247611c5308f41d95389a1;hpb=d5a39857691dfd86c2b1fb3a7ba6161b98130ab1 diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h index cb0d903..1e53396 100644 --- a/tests/common/thread-id.h +++ b/tests/common/thread-id.h @@ -68,7 +68,14 @@ unsigned long urcu_get_thread_id(void) pthread_t thr = pthread_self(); return pthread_getsequence_np(&thr); } +#elif defined(__OpenBSD__) +#include +static inline +unsigned long urcu_get_thread_id(void) +{ + return (unsigned long) getthrid(); +} #else # warning "use pid as thread ID" static inline