1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
5 pthread_mutex_t Mutex
= PTHREAD_MUTEX_INITIALIZER
;
7 void *Thread(void *x
) {
8 AnnotateIgnoreSyncBegin(0, 0);
9 pthread_mutex_lock(&Mutex
);
11 pthread_mutex_unlock(&Mutex
);
12 AnnotateIgnoreSyncEnd(0, 0);
18 pthread_create(&t
, 0, Thread
, 0);
19 pthread_mutex_lock(&Mutex
);
21 pthread_mutex_unlock(&Mutex
);
25 // CHECK: WARNING: ThreadSanitizer: data race