[llvm-commits] [compiler-rt] r173023 - /compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc
Kostya Serebryany
kcc at google.com
Mon Jan 21 03:20:49 PST 2013
Author: kcc
Date: Mon Jan 21 05:20:49 2013
New Revision: 173023
URL: http://llvm.org/viewvc/llvm-project?rev=173023&view=rev
Log:
[tsan] fix thread_name.cc test to work with older versions of libc
Modified:
compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc
Modified: compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc?rev=173023&r1=173022&r2=173023&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc Mon Jan 21 05:20:49 2013
@@ -15,7 +15,11 @@
}
void *Thread2(void *x) {
+#if defined(__linux__) && __GLIBC_PREREQ(2, 12)
pthread_setname_np(pthread_self(), "Thread2");
+#else
+ AnnotateThreadName(__FILE__, __LINE__, "Thread2");
+#endif
Global--;
return NULL;
}
More information about the llvm-commits
mailing list