Quantcast
Viewing latest article 17
Browse Latest Browse All 25

Created Unassigned: Bug in AlgorithmBase ?! [65209]

For my Version, I fixed the below in AlgorithmBase.cs (commented out the original code and added PendingAbortion state) and it works fine now when aborting an Algorithm using Abort().

The switch case for PendingAbortion will never be executed if the contract requires Aborted state.

protected void EndComputation()
{
Contract.Requires(
this.State == ComputationState.Running ||
this.State == ComputationState.PendingAbortion
/*this.State == ComputationState.Aborted*/);
lock (this.syncRoot)
{
switch (this.state)
{
case ComputationState.Running:
this.state = ComputationState.Finished;
this.OnFinished(EventArgs.Empty);
break;
case ComputationState.PendingAbortion:
this.state = ComputationState.Aborted;
this.OnAborted(EventArgs.Empty);
break;
default:
throw new InvalidOperationException();
}
this.Services.CancelManager.ResetCancel();
this.OnStateChanged(EventArgs.Empty);
}
}

Viewing latest article 17
Browse Latest Browse All 25

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>