From fe8b0105d29ef9f4addd1ced9cb28729b85ef554 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 14 Jun 2017 10:57:40 -0400 Subject: [PATCH] add apple-specific way of getting the thread id --- src/zm_timer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zm_timer.h b/src/zm_timer.h index 221aec222..582badccb 100644 --- a/src/zm_timer.h +++ b/src/zm_timer.h @@ -43,6 +43,10 @@ private: #else #ifdef __FreeBSD_kernel__ if ( (syscall(SYS_thr_self, &tid)) < 0 ) // Thread/Process id + #elif defined(__APPLE__) && defined(__MACH__) + uint64_t tid64; + pthread_threadid_np(NULL, &tid64); + tid = (pid_t)tid64; #else tid=syscall(SYS_gettid); #endif