forked from OSchip/llvm-project
[OpenMP][Tests] fix data race in an OpenMP runtime test
Reviewed by: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D81804
This commit is contained in:
parent
ad1c46c3c0
commit
9e5aefc5f9
|
@ -47,10 +47,14 @@ int main()
|
||||||
// all tasks, and detect the test failure if it has not been done yet.
|
// all tasks, and detect the test failure if it has not been done yet.
|
||||||
if (failed < 0)
|
if (failed < 0)
|
||||||
failed = throttling ? enqueued == NUM_TASKS : enqueued < NUM_TASKS;
|
failed = throttling ? enqueued == NUM_TASKS : enqueued < NUM_TASKS;
|
||||||
|
#pragma omp atomic write
|
||||||
block = 0;
|
block = 0;
|
||||||
}
|
}
|
||||||
while (block)
|
int wait = 0;
|
||||||
;
|
do {
|
||||||
|
#pragma omp atomic read
|
||||||
|
wait = block;
|
||||||
|
} while (wait);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
block = 0;
|
block = 0;
|
||||||
|
|
Loading…
Reference in New Issue