throwIfCancelled method

void throwIfCancelled()

Throws the cancellation exception if the token has already been cancelled.

Implementation

void throwIfCancelled() {
  if (isCancelled) throw exception!;
}