diff options
Diffstat (limited to 'compiler-rt/lib/tsan/output_tests/race_on_barrier.c')
| -rw-r--r-- | compiler-rt/lib/tsan/output_tests/race_on_barrier.c | 31 | 
1 files changed, 0 insertions, 31 deletions
diff --git a/compiler-rt/lib/tsan/output_tests/race_on_barrier.c b/compiler-rt/lib/tsan/output_tests/race_on_barrier.c deleted file mode 100644 index 98d7a1d847f..00000000000 --- a/compiler-rt/lib/tsan/output_tests/race_on_barrier.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <pthread.h> -#include <stdio.h> -#include <stddef.h> -#include <unistd.h> - -pthread_barrier_t B; -int Global; - -void *Thread1(void *x) { -  pthread_barrier_init(&B, 0, 2); -  pthread_barrier_wait(&B); -  return NULL; -} - -void *Thread2(void *x) { -  usleep(1000000); -  pthread_barrier_wait(&B); -  return NULL; -} - -int main() { -  pthread_t t; -  pthread_create(&t, NULL, Thread1, NULL); -  Thread2(0); -  pthread_join(t, NULL); -  pthread_barrier_destroy(&B); -  return 0; -} - -// CHECK:      WARNING: ThreadSanitizer: data race -  | 

