[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.
This commit is contained in:
Lang Hames 2021-10-10 21:09:29 -07:00
parent 4d7cea3d2e
commit c59ebe4c4c

View File

@ -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