[Openmp-commits] [PATCH] D76755: Fix build on macOS sdk 10.12 and newer

Ni Hui via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Apr 5 03:11:42 PDT 2020


nihui updated this revision to Diff 255131.
nihui added a comment.

use pthread_mach_thread_np() unconditionally


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76755/new/

https://reviews.llvm.org/D76755

Files:
  openmp/runtime/src/kmp_wrapper_getpid.h


Index: openmp/runtime/src/kmp_wrapper_getpid.h
===================================================================
--- openmp/runtime/src/kmp_wrapper_getpid.h
+++ openmp/runtime/src/kmp_wrapper_getpid.h
@@ -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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76755.255131.patch
Type: text/x-patch
Size: 480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200405/761a4055/attachment.bin>


More information about the Openmp-commits mailing list