1 // RUN: %clang_tsan %s -o %t
2 // RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
9 os_unfair_lock lock
= OS_UNFAIR_LOCK_INIT
;
11 void *Thread(void *a
) {
12 os_unfair_lock_lock(&lock
);
14 os_unfair_lock_unlock(&lock
);
21 pthread_create(&t1
, NULL
, Thread
, NULL
);
22 pthread_create(&t2
, NULL
, Thread
, NULL
);
23 pthread_join(t1
, NULL
);
24 pthread_join(t2
, NULL
);
25 fprintf(stderr
, "global_variable = %ld\n", global_variable
);
28 // CHECK: global_variable = 2