mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01: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
4f8014aa66
commit
52bc19513e
@ -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…
x
Reference in New Issue
Block a user