[llvm] c59ebe4 - [ORC] Add TaskDispatcher::shutdown calls to TaskDispatchTest.cpp unit tests.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 10 21:11:25 PDT 2021
Author: Lang Hames
Date: 2021-10-10T21:09:29-07:00
New Revision: c59ebe4c4c2d125a8a0b788f5af5d4d052d38818
URL: https://github.com/llvm/llvm-project/commit/c59ebe4c4c2d125a8a0b788f5af5d4d052d38818
DIFF: https://github.com/llvm/llvm-project/commit/c59ebe4c4c2d125a8a0b788f5af5d4d052d38818.diff
LOG: [ORC] Add TaskDispatcher::shutdown calls to TaskDispatchTest.cpp unit tests.
These calls were left out of 4d7cea3d2e8. In the InPlaceDispatcher test case
the operation is a no-op, but it's good form to include it. In the
DynamicThreadPoolTaskDispatcher test the shutdown call is required to ensure
that we don't exit the test (and tear down the dispatcher) before the thread
running the dispatch has completed.
Added:
Modified:
llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp b/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp
index 60a5e755f91f0..83d386c631ddd 100644
--- a/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp
@@ -19,6 +19,7 @@ TEST(InPlaceTaskDispatchTest, GenericNamedTask) {
bool B = false;
D->dispatch(makeGenericNamedTask([&]() { B = true; }));
EXPECT_TRUE(B);
+ D->shutdown();
}
#if LLVM_ENABLE_THREADS
@@ -29,5 +30,6 @@ TEST(DynamicThreadPoolDispatchTest, GenericNamedTask) {
D->dispatch(makeGenericNamedTask(
[P = std::move(P)]() mutable { P.set_value(true); }));
EXPECT_TRUE(F.get());
+ D->shutdown();
}
#endif
More information about the llvm-commits
mailing list