From a645d5392e5d23c01fa17d543fc70f428794159c Mon Sep 17 00:00:00 2001 From: wuestholz Date: Thu, 31 Jul 2014 09:36:39 +0200 Subject: Changed how canceled tasks are dealt with. --- Source/ExecutionEngine/ExecutionEngine.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Source/ExecutionEngine/ExecutionEngine.cs') diff --git a/Source/ExecutionEngine/ExecutionEngine.cs b/Source/ExecutionEngine/ExecutionEngine.cs index dedb3981..05c4b44b 100644 --- a/Source/ExecutionEngine/ExecutionEngine.cs +++ b/Source/ExecutionEngine/ExecutionEngine.cs @@ -944,12 +944,22 @@ namespace Microsoft.Boogie } // Execute the tasks. - for (int i = 0; i < stablePrioritizedImpls.Length && outcome != PipelineOutcome.FatalError; i++) + int j = 0; + for (; j < stablePrioritizedImpls.Length && outcome != PipelineOutcome.FatalError; j++) { - semaphore.Wait(cts.Token); - tasks[i].Start(TaskScheduler.Default); + try + { + semaphore.Wait(cts.Token); + } + catch (OperationCanceledException) + { + break; + } + tasks[j].Start(TaskScheduler.Default); } + // Don't wait for tasks that haven't been started yet. + tasks = tasks.Take(j).ToArray(); Task.WaitAll(tasks); } catch (AggregateException ae) @@ -971,9 +981,6 @@ namespace Microsoft.Boogie return false; }); } - catch (OperationCanceledException) - { - } finally { CleanupCheckers(requestId); -- cgit v1.2.3