1 /* { dg-shouldfail "tsan" } */
11 void *Thread1(void *x
) {
12 if (pthread_barrier_wait(&B
) == PTHREAD_BARRIER_SERIAL_THREAD
)
13 pthread_barrier_destroy(&B
);
17 void *Thread2(void *x
) {
18 if (pthread_barrier_wait(&B
) == PTHREAD_BARRIER_SERIAL_THREAD
)
19 pthread_barrier_destroy(&B
);
24 pthread_barrier_init(&B
, 0, 2);
26 pthread_create(&t
, NULL
, Thread1
, NULL
);
28 pthread_join(t
, NULL
);
32 /* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */