1 // RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s
15 pthread_mutex_lock(&m
);
16 pthread_cleanup_push((void(*)(void *arg
))pthread_mutex_unlock
, &m
);
18 pthread_cond_wait(&c
, &m
);
19 pthread_cleanup_pop(1);
26 pthread_mutex_init(&m
, 0);
27 pthread_cond_init(&c
, 0);
29 pthread_create(&th
, 0, thr1
, 0);
30 sleep(1); // let it block on cond var
34 pthread_mutex_lock(&m
);
35 pthread_mutex_unlock(&m
);
36 fprintf(stderr
, "OK\n");