TaskCompletionSource<TResult>.SetCanceled method

Transitions the underlying task into the Canceled state.

public virtual void SetCanceled()

Exceptions

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

See Also