[PATCH] D18951: [sanitizer] Use pthread_threadid_np as thread ID on OS X

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 02:08:13 PDT 2016


dvyukov added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:233
@@ -232,2 +232,3 @@
 uptr GetTid() {
-  return reinterpret_cast<uptr>(pthread_self());
+  uint64_t tid;
+  pthread_threadid_np(nullptr, &tid);
----------------
Is it OK that the value is potentially truncated?


http://reviews.llvm.org/D18951





More information about the llvm-commits mailing list