1 // RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
5 extern "C" void AnnotateIgnoreSyncBegin(const char*, int);
6 extern "C" void AnnotateIgnoreSyncEnd(const char*, int);
9 pthread_mutex_t Mutex
= PTHREAD_MUTEX_INITIALIZER
;
11 void *Thread(void *x
) {
12 AnnotateIgnoreSyncBegin(0, 0);
13 pthread_mutex_lock(&Mutex
);
15 pthread_mutex_unlock(&Mutex
);
16 AnnotateIgnoreSyncEnd(0, 0);
22 pthread_create(&t
, 0, Thread
, 0);
23 pthread_mutex_lock(&Mutex
);
25 pthread_mutex_unlock(&Mutex
);
29 // CHECK: WARNING: ThreadSanitizer: data race