1 // RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // CHECK-NOT: unlock of unlocked mutex
3 // CHECK: ThreadSanitizer: data race
4 // CHECK: pthread_cond_signal
19 pthread_mutex_lock(&c
->m
);
21 pthread_mutex_unlock(&c
->m
);
22 pthread_cond_signal(&c
->c
);
28 pthread_mutex_init(&c
->m
, 0);
29 pthread_cond_init(&c
->c
, 0);
31 pthread_create(&th
, 0, thr
, c
);
32 pthread_mutex_lock(&c
->m
);
34 pthread_cond_wait(&c
->c
, &c
->m
);
35 pthread_mutex_unlock(&c
->m
);
36 // w/o this sleep, it can be reported as use-after-free