Change behaviour of cancel in PipelineExecutor

This commit is contained in:
exX512 2023-01-26 21:30:36 +00:00
parent 76d6e2edf9
commit 1793730df8
2 changed files with 9 additions and 2 deletions

View File

@ -400,7 +400,9 @@ void ExecutingGraph::cancel()
{
try
{
processor->cancel();
bool is_source = processor->getInputs().empty();
if (is_source)
processor->cancel();
}
catch (...)
{

View File

@ -70,7 +70,6 @@ const Processors & PipelineExecutor::getProcessors() const
void PipelineExecutor::cancel()
{
cancelled = true;
finish();
graph->cancel();
}
@ -147,7 +146,10 @@ bool PipelineExecutor::checkTimeLimitSoft()
// We call cancel here so that all processors are notified and tasks waken up
// so that the "break" is faster and doesn't wait for long events
if (!continuing)
{
cancel();
finish();
}
return continuing;
}
@ -227,7 +229,10 @@ void PipelineExecutor::executeStepImpl(size_t thread_num, std::atomic_bool * yie
break;
if (!context.executeTask())
{
cancel();
finish();
}
if (tasks.isFinished())
break;