[PATCH] D10606: __tsan::ThreadCreate takes incorrect value for detached argument

Ismail Pazarbasi ismail.pazarbasi at gmail.com
Fri Jul 24 13:01:10 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243151: __tsan::ThreadCreate takes incorrect value for detached argument (authored by ismailp).

Changed prior to commit:
  http://reviews.llvm.org/D10606?vs=28257&id=30597#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D10606

Files:
  compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc

Index: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
===================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
@@ -38,6 +38,13 @@
 #define stderr __stderrp
 #endif
 
+#if SANITIZER_LINUX || SANITIZER_FREEBSD
+#define PTHREAD_CREATE_DETACHED 1
+#elif SANITIZER_MAC
+#define PTHREAD_CREATE_DETACHED 2
+#endif
+
+
 #ifdef __mips__
 const int kSigCount = 129;
 #else
@@ -880,7 +887,8 @@
     ThreadIgnoreEnd(thr, pc);
   }
   if (res == 0) {
-    int tid = ThreadCreate(thr, pc, *(uptr*)th, detached);
+    int tid = ThreadCreate(thr, pc, *(uptr*)th,
+                           detached == PTHREAD_CREATE_DETACHED);
     CHECK_NE(tid, 0);
     // Synchronization on p.tid serves two purposes:
     // 1. ThreadCreate must finish before the new thread starts.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10606.30597.patch
Type: text/x-patch
Size: 884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150724/4c10e7fc/attachment.bin>


More information about the llvm-commits mailing list