36 references to CancellationToken
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (1)
15private static readonly CancellationToken s_precancelledToken = new CancellationToken(true);
Microsoft.AspNetCore.Components (1)
RenderTree\Renderer.cs (1)
31internal static readonly Task CanceledRenderTask = Task.FromCanceled(new CancellationToken(canceled: true));
Microsoft.AspNetCore.Components.Server (1)
Circuits\RemoteRenderer.cs (1)
21private static readonly Task CanceledTask = Task.FromCanceled(new CancellationToken(canceled: true));
Microsoft.AspNetCore.Server.HttpSys (2)
MessagePump.cs (1)
266StopAsync(new CancellationToken(canceled: true)).GetAwaiter().GetResult();
RequestProcessing\RequestContext.cs (1)
173_disconnectToken = new CancellationToken(canceled: true);
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.IHttpRequestLifetimeFeature.cs (1)
30return new CancellationToken(true);
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\Http\HttpProtocol.cs (2)
308return new CancellationToken(false); 313return new CancellationToken(true);
Internal\KestrelServerImpl.cs (1)
287StopAsync(new CancellationToken(canceled: true)).GetAwaiter().GetResult();
Microsoft.CodeAnalysis (6)
DiagnosticAnalyzer\AnalyzerDriver.cs (4)
453_lazyInitializeTask = Task.FromCanceled(new CancellationToken(canceled: true)); 456_lazyPrimaryTask = Task.FromCanceled(new CancellationToken(canceled: true)); 662_lazyPrimaryTask ??= Task.FromCanceled(new CancellationToken(canceled: true)); 696_lazyPrimaryTask = Task.FromCanceled(new CancellationToken(canceled: true));
DiagnosticAnalyzer\AsyncQueue.cs (2)
240: Task.FromCanceled<TElement>(new CancellationToken(canceled: true)); 249new CancellationToken(canceled: true).ThrowIfCancellationRequested();
Microsoft.Extensions.AI.Abstractions.Tests (2)
Image\ImageGeneratorExtensionsTests.cs (2)
68var cancellationToken = new CancellationToken(canceled: false); 114var cancellationToken = new CancellationToken(canceled: false);
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Logging\HttpRequestBodyReaderTest.cs (1)
111var token = new CancellationToken(true);
Logging\HttpResponseBodyReaderTest.cs (2)
134var token = new CancellationToken(true); 242var token = new CancellationToken(true);
Microsoft.Extensions.Http.Resilience.Tests (1)
Polly\HttpRetryStrategyOptionsTests.cs (1)
29[new OperationCanceledExceptionMock(new TimeoutException()), new CancellationToken(canceled: true), false],
Microsoft.Gen.Logging.Unit.Tests (1)
ParserTests.cs (1)
601", cancellationToken: new CancellationToken(true)));
Microsoft.Gen.Metrics.Unit.Tests (1)
ParserTests.cs (1)
561cancellationToken: new CancellationToken(true)));
Microsoft.Gen.MetricsReports.Unit.Tests (1)
EmitterTests.cs (1)
87emitter.GenerateReport(_metricClasses, new CancellationToken(true));
System.Data.Common (1)
System\Data\Common\AdapterUtil.Common.cs (1)
22internal static Task<T> CreatedTaskWithCancellation<T>() => Task.FromCanceled<T>(new CancellationToken(true));
System.Linq.Parallel (1)
System\Linq\Parallel\Scheduling\CancellationState.cs (1)
39return new CancellationToken(false);
System.Net.WebSockets (1)
System\Net\WebSockets\WebSocketStream.cs (1)
260ct = new CancellationToken(canceled: true);
System.Private.CoreLib (6)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExtensions.cs (2)
22Task.FromCanceled(new CancellationToken(true)); 38Task.FromCanceled<TResult>(new CancellationToken(true));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (4)
226return s_canceledTask ??= Task.FromCanceled(new CancellationToken(canceled: true)); 278vtst.TrySetCanceled(new CancellationToken(true)); 637return s_canceledTask ??= Task.FromCanceled<TResult>(new CancellationToken(true)); 688vtst.TrySetCanceled(new CancellationToken(true));
System.ServiceModel.Federation (1)
System\Runtime\TimeoutHelper.cs (1)
12private static readonly CancellationToken s_precancelledToken = new CancellationToken(true);
System.ServiceModel.Primitives (1)
Internals\System\Runtime\TimeoutHelper.cs (1)
16private static readonly CancellationToken s_precancelledToken = new CancellationToken(true);
System.Threading.Channels (1)
System\Threading\Channels\ChannelUtilities.cs (1)
63error is OperationCanceledException oce ? Task.FromCanceled<T>(oce.CancellationToken.IsCancellationRequested ? oce.CancellationToken : new CancellationToken(true)) :