Redigera

Dela via


TaskCompletionSource.SetCanceled Method

Definition

Overloads

SetCanceled()

Transitions the underlying Task into the Canceled state.

SetCanceled(CancellationToken)

Transitions the underlying Task into the Canceled state using the specified token.

SetCanceled()

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Transitions the underlying Task into the Canceled state.

public:
 void SetCanceled();
public void SetCanceled ();
member this.SetCanceled : unit -> unit
Public Sub SetCanceled ()

Exceptions

The underlying Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

Applies to

SetCanceled(CancellationToken)

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Transitions the underlying Task into the Canceled state using the specified token.

public:
 void SetCanceled(System::Threading::CancellationToken cancellationToken);
public void SetCanceled (System.Threading.CancellationToken cancellationToken);
member this.SetCanceled : System.Threading.CancellationToken -> unit
Public Sub SetCanceled (cancellationToken As CancellationToken)

Parameters

cancellationToken
CancellationToken

The cancellation token with which to cancel the Task.

Exceptions

The underlying Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

Applies to