[llvm] [ORC] Fix synchronization in CoreAPIsTest. (PR #144556)
Jameson Nash via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 08:51:17 PDT 2025
================
@@ -1559,16 +1559,13 @@ TEST_F(CoreAPIsStandardTest, TestLookupWithThreadedMaterialization) {
#if LLVM_ENABLE_THREADS
std::mutex WorkThreadsMutex;
- std::vector<std::thread> WorkThreads;
+ SmallVector<std::thread,0> WorkThreads;
DispatchOverride = [&](std::unique_ptr<Task> T) {
- std::promise<void> WaitP;
- std::lock_guard<std::mutex> Lock(WorkThreadsMutex);
+ std::unique_lock Lock(WorkThreadsMutex);
----------------
vtjnash wrote:
Yeah, I am made slightly uncomfortable by using two completely different RAII locks on the same mutex, though I realize that it is well-defined, so I dropped this part of the chagne. The other changes are all related to the bug fix, so it isn't particularly easy to justify separating them (SmallVector is needed because the iteration structure needed to change and the relevant feature is part of SmallVector not std::vector)
https://github.com/llvm/llvm-project/pull/144556
More information about the llvm-commits
mailing list