Exemple #1
0
 private static async Task DoWaitWhilePausedAsync(Task waitTask, CancellationToken token) {
     using (var taskSource = token.ToCancellationTokenTaskSource()) {
         var completedTask = await TaskShim.WhenAny(waitTask, taskSource.Task).ConfigureAwait(false);
         await completedTask.ConfigureAwait(false);
     }
 }