29TEST(TaskRunnerUtilTests, ConditionalBasicTaskRunnerPostTask) {
31 std::atomic_bool active =
true;
33 [&active]() ->
bool { return active; });
36 std::atomic_bool task1_called =
false;
38 task1_called.store(
true);
45 std::atomic_bool task2_called =
false;
46 runner.
PostTask([&]() { task2_called.store(
true); });
53 EXPECT_TRUE(task1_called.load());
54 EXPECT_FALSE(task2_called.load());