cancel workers when exception

This commit is contained in:
Sema Checherinda 2023-02-23 12:00:56 +01:00 committed by Sema Checherinda
parent 08dc874a37
commit e2bfa83429

View File

@ -166,6 +166,8 @@ private:
std::vector<std::future<void>> futures;
SCOPE_EXIT_SAFE({
/// Cancel all workers
worker_state.next_task.store(worker_state.tasks.size());
/// Exceptions are not propagated
for (auto & future : futures)
if (future.valid())