Better exceptions safety in PipelineExecutor.

This commit is contained in:
Nikolai Kochetov 2019-04-08 14:06:11 +03:00
parent 83a2242e2d
commit fa5bc611ae

View File

@ -144,14 +144,15 @@ void PipelineExecutor::addJob(UInt64 pid)
{ {
auto job = [this, pid]() auto job = [this, pid]()
{ {
SCOPE_EXIT(event_counter.notify()); SCOPE_EXIT(
graph[pid].processor->work();
{ {
std::lock_guard lock(finished_execution_mutex); std::lock_guard lock(finished_execution_mutex);
finished_execution_queue.push(pid); finished_execution_queue.push(pid);
} }
event_counter.notify()
);
graph[pid].processor->work();
}; };
pool->schedule(createExceptionHandledJob(std::move(job), exception_handler)); pool->schedule(createExceptionHandledJob(std::move(job), exception_handler));