Skip to content

Commit

Permalink
[OpenMP][Tests] fix data race in an OpenMP runtime test
Browse files Browse the repository at this point in the history
Reviewed by: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D81804
  • Loading branch information
jprotze committed Jun 15, 2020
1 parent ad1c46c commit 9e5aefc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions openmp/runtime/test/tasking/omp_fill_taskqueue.c
Expand Up @@ -47,10 +47,14 @@ int main()
// all tasks, and detect the test failure if it has not been done yet.
if (failed < 0)
failed = throttling ? enqueued == NUM_TASKS : enqueued < NUM_TASKS;
#pragma omp atomic write
block = 0;
}
while (block)
;
int wait = 0;
do {
#pragma omp atomic read
wait = block;
} while (wait);
}
}
block = 0;
Expand Down

0 comments on commit 9e5aefc

Please sign in to comment.