[compiler-rt] r257758 - [tsan] Fix the value of PTHREAD_MUTEX_RECURSIVE for OS X and FreeBSD

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 04:13:00 PST 2016


Author: kuba.brecka
Date: Thu Jan 14 06:12:58 2016
New Revision: 257758

URL: http://llvm.org/viewvc/llvm-project?rev=257758&view=rev
Log:
[tsan] Fix the value of PTHREAD_MUTEX_RECURSIVE for OS X and FreeBSD

The value of the constant PTHREAD_MUTEX_RECURSIVE is not "1" on FreeBSD and OS X.

Differential Revision: http://reviews.llvm.org/D16075


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

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=257758&r1=257757&r2=257758&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Jan 14 06:12:58 2016
@@ -121,8 +121,13 @@ extern "C" int dirfd(void *dirp);
 extern "C" int mallopt(int param, int value);
 #endif
 extern __sanitizer_FILE *stdout, *stderr;
+#if !SANITIZER_FREEBSD && !SANITIZER_MAC
 const int PTHREAD_MUTEX_RECURSIVE = 1;
 const int PTHREAD_MUTEX_RECURSIVE_NP = 1;
+#else
+const int PTHREAD_MUTEX_RECURSIVE = 2;
+const int PTHREAD_MUTEX_RECURSIVE_NP = 2;
+#endif
 const int EINVAL = 22;
 const int EBUSY = 16;
 const int EOWNERDEAD = 130;




More information about the llvm-commits mailing list