diff --git a/openmp/runtime/test/tasking/omp_fill_taskqueue.c b/openmp/runtime/test/tasking/omp_fill_taskqueue.c --- a/openmp/runtime/test/tasking/omp_fill_taskqueue.c +++ b/openmp/runtime/test/tasking/omp_fill_taskqueue.c @@ -47,10 +47,14 @@ // 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;