diff options
| author | Kostya Serebryany <kcc@google.com> | 2013-01-21 11:20:49 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2013-01-21 11:20:49 +0000 |
| commit | 9b46312c87561f0e7fe286de5d7341a139bee067 (patch) | |
| tree | bf9769419cb94c53df98fafd3e0f21c4a1a421d6 | |
| parent | 3e0a363021a96fc14742a803caa2d9f7855b28d4 (diff) | |
| download | bcm5719-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.cc | 4 |
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; } |

