summaryrefslogtreecommitdiff
path: root/Source/ExecutionEngine/ExecutionEngine.cs
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2014-07-31 09:36:39 +0200
committerGravatar wuestholz <unknown>2014-07-31 09:36:39 +0200
commita645d5392e5d23c01fa17d543fc70f428794159c (patch)
tree0eadd0fbf70851d6d44d50f189e1a31b1959c286 /Source/ExecutionEngine/ExecutionEngine.cs
parente5e07af52dc1e27689c55ff3ff581e39b61e17b8 (diff)
Changed how canceled tasks are dealt with.
Diffstat (limited to 'Source/ExecutionEngine/ExecutionEngine.cs')
-rw-r--r--Source/ExecutionEngine/ExecutionEngine.cs19
1 files changed, 13 insertions, 6 deletions
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);