public void ThrowIfCancellationRequested() { if (IsCancellationRequested) { LitCancelException.Throw(); } }
public void GetResult(short token) { AssertTokenNotExpired(token); try{ var status = GetStatus(token); switch (status) { case ValueSourceStatus.Canceled: LitCancelException.Throw(); break; default: return; } }finally{ this.ReturnToPool(); } }