System.Threading.Tasks.ParallelLoopState.ShouldExitCurrentIteration Property

Gets whether the current iteration of the loop should exit based on requests made by this or other iterations.

Syntax

public bool ShouldExitCurrentIteration { get; }

Value

Documentation for this section has not yet been entered.

Remarks

When an iteration of a loop calls ParallelLoopState.Break or ParallelLoopState.Stop, or when one throws an exception, or when the loop is canceled, the System.Threading.Tasks.Parallel class will proactively attempt to prohibit additional iterations of the loop from starting execution.

However, there may be cases where it is unable to prevent additional iterations from starting.

It may also be the case that a long-running iteration has already begun execution. In such cases, iterations may explicitly check the ParallelLoopState.ShouldExitCurrentIteration property and cease execution if the property returns true.

Requirements

Namespace: System.Threading.Tasks
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0