mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 23:51:56 +00:00
[ORC] Fix race condtition in CoreAPIsTest.
This test has been failing intermittently on some builders, probably due to a race on the WorkThreads vector. This patch should fix that.
This commit is contained in:
parent
7f0acc4e4f
commit
fda4300da8
@ -1249,8 +1249,10 @@ TEST_F(CoreAPIsStandardTest, TestLookupWithUnthreadedMaterialization) {
|
||||
TEST_F(CoreAPIsStandardTest, TestLookupWithThreadedMaterialization) {
|
||||
#if LLVM_ENABLE_THREADS
|
||||
|
||||
std::mutex WorkThreadsMutex;
|
||||
std::vector<std::thread> WorkThreads;
|
||||
ES.setDispatchTask([&](std::unique_ptr<Task> T) {
|
||||
std::lock_guard<std::mutex> Lock(WorkThreadsMutex);
|
||||
WorkThreads.push_back(
|
||||
std::thread([T = std::move(T)]() mutable { T->run(); }));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user