add apple-specific way of getting the thread id
This commit is contained in:
parent
b59e870fd4
commit
fe8b0105d2
|
@ -43,6 +43,10 @@ private:
|
||||||
#else
|
#else
|
||||||
#ifdef __FreeBSD_kernel__
|
#ifdef __FreeBSD_kernel__
|
||||||
if ( (syscall(SYS_thr_self, &tid)) < 0 ) // Thread/Process id
|
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
|
#else
|
||||||
tid=syscall(SYS_gettid);
|
tid=syscall(SYS_gettid);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue