Skip to content

Commit 2b3aff8

Browse files
committed
[ORC] Don't notify condition variable when condition is not met.
Avoids waking threads when the condition to proceed won't be met. NFC.
1 parent 21a1dbb commit 2b3aff8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/ExecutionEngine/Orc/TaskDispatch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ void DynamicThreadPoolTaskDispatcher::dispatch(std::unique_ptr<Task> T) {
6868
if (IsMaterializationTask)
6969
--NumMaterializationThreads;
7070
--Outstanding;
71-
OutstandingCV.notify_all();
71+
if (Outstanding == 0)
72+
OutstandingCV.notify_all();
7273
return;
7374
}
7475
}

0 commit comments

Comments
 (0)