13 references to Cancellation
System.Threading.Tasks.Parallel (13)
System\Threading\Tasks\Parallel.ForEachAsync.cs (13)
105while (!state.Cancellation.IsCancellationRequested) 129if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 156await state.LoopBody(element, state.Cancellation.Token); 269while (!state.Cancellation.IsCancellationRequested) 276if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 301await state.LoopBody(element, state.Cancellation.Token); 424while (!state.Cancellation.IsCancellationRequested) 431if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 456await state.LoopBody(element, state.Cancellation.Token); 553_registration = cancellationToken.UnsafeRegister(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this); 626Cancellation.Cancel(); 653Debug.Assert(!Cancellation.IsCancellationRequested); 718Enumerator = source.GetAsyncEnumerator(Cancellation.Token) ?? throw new InvalidOperationException(SR.Parallel_ForEach_NullEnumerator);