Executes each of the provided actions, possibly in parallel.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Shared Sub Invoke ( _
parallelOptions As ParallelOptions, _
ParamArray actions As Action() _
) |
| C# |
|---|
public static void Invoke(
ParallelOptions parallelOptions,
params Action[] actions
) |
Remarks
Exceptions
| Exception | Condition |
|---|
| System..::.ArgumentNullException | The exception that is thrown when the
actions argument is null. |
| System..::.ArgumentNullException | The exception that is thrown when the
parallelOptions argument is null. |
| System..::.ArgumentException | The exception that is thrown when the
actions array contains a null element. |
| System..::.OperationCanceledException | The exception that is thrown when
the CancellationToken in the
parallelOptions is set. |
| System..::.AggregateException | The exception that is thrown when any
action in the actions array throws an exception. |
| System..::.ObjectDisposedException | The exception that is thrown when the
the CancellationTokenSource associated with the
the CancellationToken in the
parallelOptions has been disposed. |
See Also