Exemplo n.º 1
0
        public static Task <T> FromCanceled <T>(this CancellationToken cancellationToken)
        {
            MiscellaneousUtils.Assert(cancellationToken.IsCancellationRequested);
#pragma warning disable CS8603 // Possible null reference return.
            return(new Task <T>(() => default, cancellationToken));
Exemplo n.º 2
0
 public static Task FromCanceled(this CancellationToken cancellationToken)
 {
     MiscellaneousUtils.Assert(cancellationToken.IsCancellationRequested);
     return(new Task(() => {}, cancellationToken));
 }