1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
8 void *Thread(void *x
) {
9 // wait for shutown signal
10 while (read(pipes
[0], &x
, 1) != 1) {
21 pthread_create(&t
, 0, Thread
, 0);
22 // send shutdown signal
23 while (write(pipes
[1], &t
, 1) != 1) {
26 fprintf(stderr
, "OK\n");
29 // CHECK-NOT: WARNING: ThreadSanitizer: data race