Scheduler now completing work
This commit is contained in:
@@ -13,12 +13,12 @@ TEST_CASE("Threadpool Construction", "[threadpool]") {
|
||||
|
||||
std::vector<std::future<uint32_t>> rets;
|
||||
|
||||
SECTION("Simple runs") {
|
||||
SECTION("Adding large tasks queues with return values") {
|
||||
auto tq = std::make_shared<daggy::TaskQueue>();
|
||||
std::vector<std::future<uint32_t>> res;
|
||||
for (size_t i = 0; i < 100; ++i)
|
||||
res.emplace_back(std::move(tq->addTask([&cnt]() { cnt++; return cnt.load(); })));
|
||||
tp.addTaskQueue(tq);
|
||||
tp.addTasks(tq);
|
||||
for (auto & r : res) r.get();
|
||||
REQUIRE(cnt == 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user