Exemplo n.º 1
0
 /// <summary>
 /// Attempts to transition the underlying task into the <see cref="SystemTasks.TaskStatus.Canceled"/> state
 /// and enables a cancellation token to be stored in the canceled task.
 /// </summary>
 public static bool TrySetCanceled(SystemTasks.TaskCompletionSource <TResult> tcs,
                                   SystemThreading.CancellationToken cancellationToken) =>
 tcs.TrySetCanceled(cancellationToken);
Exemplo n.º 2
0
 /// <summary>
 /// Attempts to transition the underlying task into the <see cref="SystemTasks.TaskStatus.Canceled"/> state.
 /// </summary>
 public static bool TrySetCanceled(SystemTasks.TaskCompletionSource <TResult> tcs) => tcs.TrySetCanceled();