Wait Method (CancellationToken)

Task Parallel System.Threading

Waits for the Task to complete execution.

Namespace:  System.Threading.Tasks
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Sub Wait ( _
	cancellationToken As CancellationToken _
)
C#
public void Wait(
	CancellationToken cancellationToken
)

Parameters

cancellationToken
Type: System.Threading..::.CancellationToken
A CancellationToken()()() to observe while waiting for the task to complete.

Exceptions

ExceptionCondition
System..::.OperationCanceledException The cancellationToken was canceled.
System..::.AggregateException The Task was canceled -or- an exception was thrown during the execution of the Task.
System..::.ObjectDisposedException The Task has been disposed.

See Also