summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-01-21 11:20:49 +0000
committerKostya Serebryany <kcc@google.com>2013-01-21 11:20:49 +0000
commit9b46312c87561f0e7fe286de5d7341a139bee067 (patch)
treebf9769419cb94c53df98fafd3e0f21c4a1a421d6
parent3e0a363021a96fc14742a803caa2d9f7855b28d4 (diff)
downloadbcm5719-llvm-9b46312c87561f0e7fe286de5d7341a139bee067.tar.gz
bcm5719-llvm-9b46312c87561f0e7fe286de5d7341a139bee067.zip
[tsan] fix thread_name.cc test to work with older versions of libc
llvm-svn: 173023
-rw-r--r--compiler-rt/lib/tsan/lit_tests/thread_name.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/lit_tests/thread_name.cc b/compiler-rt/lib/tsan/lit_tests/thread_name.cc
index 0ca0b176997..afb882fcdf9 100644
--- a/compiler-rt/lib/tsan/lit_tests/thread_name.cc
+++ b/compiler-rt/lib/tsan/lit_tests/thread_name.cc
@@ -15,7 +15,11 @@ void *Thread1(void *x) {
}
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;
}
OpenPOWER on IntegriCloud