Skip to content

Commit

Permalink
Map the disposed issue to OperationCanceledException, which should be…
Browse files Browse the repository at this point in the history
… captured.
  • Loading branch information
MikaelMayer committed Aug 13, 2024
1 parent 44f0dff commit ab87a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/ExecutionEngine/VerificationTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void Cancel() {
private async IAsyncEnumerable<IVerificationStatus> StartRun([EnumeratorCancellation] CancellationToken cancellationToken) {
var timeout = Split.Run.Implementation.GetTimeLimit(Split.Options);

var checkerTask = engine.CheckerPool.FindCheckerFor(ProcessedProgram.Program, Split, cancellationToken);
var checkerTask = engine.CheckerPool.FindCheckerFor(ProcessedProgram.Program, Split, CancellationToken.None);
if (!checkerTask.IsCompleted) {
yield return new Queued();
}
Expand Down
8 changes: 4 additions & 4 deletions Source/VCGeneration/CheckerPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public CheckerPool(VCGenOptions options)

public async Task<Checker> FindCheckerFor(Program program, Split? split, CancellationToken cancellationToken)
{
if (disposed) {
throw new OperationCanceledException("CheckerPool was already disposed");
}

await checkersSemaphore.WaitAsync(cancellationToken);
try {
if (disposed) { // Now that should not happen
throw new Exception("CheckerPool was already disposed");
}

if (!availableCheckers.TryPop(out var checker)) {
checker ??= CreateNewChecker();
}
Expand Down

0 comments on commit ab87a4f

Please sign in to comment.