[tsan] fix thread_name.cc test to work with older versions of libc

llvm-svn: 173023
This commit is contained in:
Kostya Serebryany 2013-01-21 11:20:49 +00:00
parent 3e0a363021
commit 9b46312c87
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}