Skip to content

Commit 0c5db1c

Browse files
fix compilation warning in macOS.
1 parent ed8dcd4 commit 0c5db1c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tfcore_unix.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include <sys/wait.h>
88
#include <fcntl.h>
99
#include <aio.h>
10+
#ifdef Q_OS_DARWIN
11+
#include <pthread.h>
12+
#endif
1013
#include "tfcore.h"
1114

1215
#ifndef Q_OS_UNIX
@@ -25,7 +28,10 @@ static inline pid_t gettid()
2528
#if defined(Q_OS_LINUX)
2629
return syscall(SYS_gettid);
2730
#elif defined(Q_OS_DARWIN)
28-
return syscall(SYS_thread_selfid);
31+
uint64_t tid;
32+
pthread_threadid_np(NULL, &tid);
33+
return tid;
34+
//return syscall(SYS_thread_selfid);
2935
#else
3036
return 0;
3137
#endif

0 commit comments

Comments
 (0)