[OpenMP] Fix build on macOS sdk 10.12 and newer
authorAndreyChurbanov <andrey.churbanov@intel.com>
Wed, 26 Aug 2020 13:52:46 +0000 (16:52 +0300)
committerAndreyChurbanov <andrey.churbanov@intel.com>
Wed, 26 Aug 2020 13:52:46 +0000 (16:52 +0300)
Patch by nihui (Ni Hui)

Differential Revision: https://reviews.llvm.org/D76755

openmp/runtime/src/kmp_wrapper_getpid.h

index 257772a..32ede3e 100644 (file)
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #if KMP_OS_DARWIN
 // OS X
-#define __kmp_gettid() syscall(SYS_thread_selfid)
+#define __kmp_gettid() pthread_mach_thread_np(pthread_self())
 #elif KMP_OS_FREEBSD
 #include <pthread_np.h>
 #define __kmp_gettid() pthread_getthreadid_np()