mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-01 13:20:25 +00:00
[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.
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user