1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
4 char s
[] = "abracadabra";
6 void *Thread0(void *p
) {
8 barrier_wait(&barrier
);
12 void *Thread1(void *p
) {
13 barrier_wait(&barrier
);
19 barrier_init(&barrier
, 2);
21 pthread_create(&th
[0], 0, Thread0
, 0);
22 pthread_create(&th
[1], 0, Thread1
, 0);
23 pthread_join(th
[0], 0);
24 pthread_join(th
[1], 0);
25 fprintf(stderr
, "DONE");
28 // CHECK: WARNING: ThreadSanitizer: data race