5 types derived from CancellationTokenSource
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
System.Private.CoreLib (3)
1047 instantiations of CancellationTokenSource
aspire (15)
aspire-managed (3)
Aspire.Acquisition.Tests (2)
Aspire.Azure.Messaging.WebPubSub.Tests (1)
Aspire.Azure.Search.Documents.Tests (1)
Aspire.Cli.Tests (82)
Aspire.Components.Common.TestUtilities (1)
Aspire.Dashboard (25)
Aspire.Dashboard.Components.Tests (1)
Aspire.Dashboard.Tests (32)
Aspire.Deployment.EndToEnd.Tests (56)
Aspire.EndToEnd.Tests (2)
Aspire.Hosting (18)
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.Kusto.Tests (6)
Aspire.Hosting.Azure.Tests (31)
Aspire.Hosting.Blazor (2)
Aspire.Hosting.Blazor.Tests (3)
Aspire.Hosting.Browsers (6)
Aspire.Hosting.Browsers.Tests (7)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
Aspire.Hosting.Containers.Tests (2)
Aspire.Hosting.DevTunnels.Tests (2)
Aspire.Hosting.Dotnet.Tests (1)
Aspire.Hosting.DotnetTool.Tests (3)
Aspire.Hosting.EntityFrameworkCore.Tests (7)
Aspire.Hosting.Foundry (2)
Aspire.Hosting.Foundry.Tests (2)
Aspire.Hosting.Garnet.Tests (3)
Aspire.Hosting.GitHub.Models.Tests (2)
Aspire.Hosting.JavaScript.Tests (8)
Aspire.Hosting.Kafka.Tests (3)
Aspire.Hosting.Maui (1)
Aspire.Hosting.Maui.Tests (5)
Aspire.Hosting.MongoDB.Tests (5)
Aspire.Hosting.MySql.Tests (12)
Aspire.Hosting.Nats.Tests (3)
Aspire.Hosting.OpenAI.Tests (3)
Aspire.Hosting.Oracle.Tests (5)
Aspire.Hosting.PostgreSQL.Tests (10)
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (2)
Aspire.Hosting.Radius.Tests (3)
Aspire.Hosting.Redis.Tests (6)
Aspire.Hosting.RemoteHost (2)
Aspire.Hosting.RemoteHost.Tests (7)
Aspire.Hosting.Rust.Tests (2)
Aspire.Hosting.Sdk.Tests (2)
Aspire.Hosting.SqlServer.Tests (7)
Aspire.Hosting.Testing (3)
Aspire.Hosting.Testing.Tests (16)
Aspire.Hosting.Tests (122)
Aspire.Hosting.TestUtilities (2)
Aspire.Hosting.Valkey.Tests (2)
Aspire.Hosting.Yarp.Tests (1)
Aspire.Managed.Tests (2)
Aspire.Milvus.Client.Tests (1)
Aspire.MongoDB.Driver.Tests (1)
Aspire.MongoDB.Driver.v2.Tests (1)
Aspire.MongoDB.EntityFrameworkCore.Tests (1)
Aspire.NATS.Net.Tests (1)
Aspire.Playground.Tests (2)
Aspire.Qdrant.Client.Tests (1)
Aspire.Seq.Tests (2)
Aspire.Templates.Tests (3)
Aspire.TerminalHost (6)
Aspire.TerminalHost.Tests (15)
CustomResources.AppHost (1)
dotnet (7)
dotnet-aot (4)
dotnet-svcutil-lib (8)
dotnet-watch (1)
GenerateDocumentationAndConfigFiles (4)
Infrastructure.Tests (19)
Microsoft.Agents.AI.ProjectTemplates.Tests (1)
Microsoft.AspNetCore.Components (2)
Microsoft.AspNetCore.Components.Endpoints (4)
Microsoft.AspNetCore.Components.Forms (1)
Microsoft.AspNetCore.Components.Media (1)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Connections.Abstractions (1)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (1)
Microsoft.AspNetCore.Hosting (5)
Microsoft.AspNetCore.Http.Connections (8)
Microsoft.AspNetCore.Http.Connections.Client (4)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Mvc (2)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.SignalR.Client.Core (10)
Microsoft.AspNetCore.SignalR.Core (3)
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.Bcl.TimeProvider (1)
Microsoft.Build (5)
Microsoft.Build.Tasks.CodeAnalysis (1)
Microsoft.Build.Tasks.Core (7)
Microsoft.CodeAnalysis.Analyzers (5)
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
Microsoft.CodeAnalysis.CodeStyle (5)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
Microsoft.CodeAnalysis.Workspaces (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.Diagnostics.NETCore.Client (11)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Cli.Telemetry (2)
Microsoft.DotNet.HotReload.Watch (8)
Microsoft.Extensions.AI.Abstractions.Tests (15)
Microsoft.Extensions.AI.OpenAI.Tests (7)
Microsoft.Extensions.AI.Templates.Tests (1)
Microsoft.Extensions.AI.Tests (37)
Microsoft.Extensions.AsyncState (1)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Hybrid.Tests (6)
Microsoft.Extensions.Compliance.Abstractions (1)
Microsoft.Extensions.Configuration (1)
Microsoft.Extensions.DataIngestion.Tests (2)
Microsoft.Extensions.Diagnostics.ExceptionSummarization.Tests (2)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Microsoft.Extensions.FileProviders.Physical (5)
Microsoft.Extensions.Hosting (3)
Microsoft.Extensions.Hosting.Abstractions (1)
Microsoft.Extensions.Hosting.Testing.Tests (3)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.Extensions.Http.Resilience.PerformanceTests (2)
Microsoft.Extensions.Http.Resilience.Tests (2)
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.Logging.EventSource (1)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.Primitives (1)
Microsoft.Extensions.ServiceDiscovery (1)
Microsoft.Extensions.ServiceDiscovery.Dns (4)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (2)
Microsoft.Extensions.ServiceDiscovery.Tests (8)
Microsoft.Extensions.Telemetry (1)
Microsoft.Extensions.Telemetry.Abstractions (1)
Microsoft.Extensions.TimeProvider.Testing.Tests (3)
Microsoft.JSInterop (11)
Microsoft.Maui (1)
Microsoft.Maui.Controls (1)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (2)
Microsoft.ML.AutoML.Tests (5)
Microsoft.ML.Core (2)
Microsoft.ML.Maml (1)
Microsoft.ML.Sweeper (1)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.NET.Build.Containers (2)
Microsoft.NET.Build.Tasks (1)
Microsoft.NET.Sdk.Publish.Tasks (2)
Microsoft.NET.Sdk.Razor.Tasks (1)
Microsoft.TemplateEngine.Cli (3)
Microsoft.TemplateEngine.Edge (2)
Microsoft.TestPlatform.CommunicationUtilities (3)
Microsoft.TestPlatform.CrossPlatEngine (2)
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
Microsoft.TestPlatform.PlatformAbstractions (1)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (3)
Microsoft.VisualBasic.Forms (2)
Microsoft.VisualStudio.TestPlatform.Common (1)
MSBuild (1)
MSBuild.Coordinator (2)
Nats.Backend (1)
NuGet.Build.Tasks (2)
NuGet.PackageManagement (1)
NuGet.Protocol (6)
Roslyn.Diagnostics.Analyzers (5)
rzc (2)
Shared (1)
Stress.AppHost (1)
System.Collections.Concurrent (2)
System.Data.Odbc (1)
System.Data.OleDb (1)
System.Diagnostics.DiagnosticSource (1)
System.Diagnostics.Process (2)
System.IO.Pipelines (2)
System.IO.Pipes (1)
System.IO.Ports (1)
System.Linq.Parallel (4)
System.Net.Http (10)
System.Net.Mail (2)
System.Net.Ping (1)
System.Net.Quic (4)
System.Net.Requests (1)
System.Net.Security (1)
System.Net.Sockets (1)
System.Net.WebSockets (1)
System.Private.CoreLib (4)
System.Security.Cryptography (1)
System.ServiceModel.Http (1)
System.ServiceModel.Primitives (3)
System.Threading.Tasks.Dataflow (2)
System.Threading.Tasks.Parallel (1)
System.Windows.Extensions (1)
System.Windows.Forms.Primitives (1)
VBCSCompiler (3)
vstest.console (1)
vstest.console.arm64 (1)
2215 references to CancellationTokenSource
aspire (88)
aspire-managed (6)
Aspire.Acquisition.Tests (2)
Aspire.Azure.Messaging.WebPubSub.Tests (1)
Aspire.Azure.Search.Documents.Tests (1)
Aspire.Cli.Tests (86)
Aspire.Components.Common.TestUtilities (1)
Aspire.Dashboard (50)
Aspire.Dashboard.Components.Tests (2)
Aspire.Dashboard.Tests (39)
Aspire.Deployment.EndToEnd.Tests (162)
Aspire.EndToEnd.Tests (2)
Aspire.Hosting (96)
Aspire.Hosting.Azure (11)
Aspire.Hosting.Azure.Kusto.Tests (17)
Aspire.Hosting.Azure.Tests (33)
Aspire.Hosting.Blazor (1)
Aspire.Hosting.Blazor.Tests (4)
Aspire.Hosting.Browsers (12)
Aspire.Hosting.Browsers.Tests (16)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
Aspire.Hosting.Containers.Tests (7)
Aspire.Hosting.DevTunnels (2)
Aspire.Hosting.DevTunnels.Tests (5)
Aspire.Hosting.Dotnet.Tests (4)
Aspire.Hosting.DotnetTool.Tests (4)
Aspire.Hosting.EntityFrameworkCore (2)
Aspire.Hosting.EntityFrameworkCore.Tests (7)
Aspire.Hosting.Foundry (6)
Aspire.Hosting.Foundry.Tests (3)
Aspire.Hosting.Garnet.Tests (3)
Aspire.Hosting.GitHub.Models.Tests (3)
Aspire.Hosting.JavaScript.Tests (9)
Aspire.Hosting.Kafka.Tests (4)
Aspire.Hosting.Maui (9)
Aspire.Hosting.Maui.Tests (5)
Aspire.Hosting.MongoDB.Tests (5)
Aspire.Hosting.MySql.Tests (13)
Aspire.Hosting.Nats.Tests (3)
Aspire.Hosting.OpenAI (2)
Aspire.Hosting.OpenAI.Tests (4)
Aspire.Hosting.Oracle.Tests (5)
Aspire.Hosting.PostgreSQL.Tests (11)
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (3)
Aspire.Hosting.Radius (2)
Aspire.Hosting.Radius.Tests (3)
Aspire.Hosting.Redis.Tests (6)
Aspire.Hosting.RemoteHost (12)
Aspire.Hosting.RemoteHost.Tests (11)
Aspire.Hosting.Rust (2)
Aspire.Hosting.Rust.Tests (2)
Aspire.Hosting.Sdk.Tests (2)
Aspire.Hosting.SqlServer.Tests (7)
Aspire.Hosting.Testing (11)
Aspire.Hosting.Testing.Tests (21)
Aspire.Hosting.Tests (209)
Aspire.Hosting.TestUtilities (6)
Aspire.Hosting.Valkey.Tests (3)
Aspire.Hosting.Yarp.Tests (1)
Aspire.Managed.Tests (2)
Aspire.Milvus.Client.Tests (1)
Aspire.MongoDB.Driver.Tests (1)
Aspire.MongoDB.Driver.v2.Tests (1)
Aspire.MongoDB.EntityFrameworkCore.Tests (1)
Aspire.NATS.Net.Tests (1)
Aspire.Playground.Tests (7)
Aspire.Qdrant.Client.Tests (1)
Aspire.Seq.Tests (2)
Aspire.Templates.Tests (3)
Aspire.TerminalHost (15)
Aspire.TerminalHost.Tests (16)
Aspire.TestTools (4)
CodeStyleConfigFileGenerator (2)
csc (2)
CustomResources.AppHost (1)
dotnet (17)
dotnet-aot (10)
dotnet-svcutil-lib (9)
dotnet-watch (3)
GenerateDocumentationAndConfigFiles (15)
Infrastructure.Common (1)
Infrastructure.Tests (19)
Microsoft.Agents.AI.ProjectTemplates.Tests (1)
Microsoft.AspNetCore.Components (3)
Microsoft.AspNetCore.Components.AI (3)
Microsoft.AspNetCore.Components.Endpoints (5)
Microsoft.AspNetCore.Components.Forms (4)
Microsoft.AspNetCore.Components.Media (3)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.Server (13)
Microsoft.AspNetCore.Components.Web (10)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Connections.Abstractions (2)
Microsoft.AspNetCore.DataProtection (2)
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (5)
Microsoft.AspNetCore.Hosting (11)
Microsoft.AspNetCore.Http (9)
Microsoft.AspNetCore.Http.Connections (14)
Microsoft.AspNetCore.Http.Connections.Client (4)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.InternalTesting (10)
Microsoft.AspNetCore.Mvc (2)
Microsoft.AspNetCore.Mvc.Core (4)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.Routing (3)
Microsoft.AspNetCore.Server.HttpSys (3)
Microsoft.AspNetCore.Server.IIS (3)
Microsoft.AspNetCore.Server.IntegrationTesting (4)
Microsoft.AspNetCore.Server.Kestrel.Core (8)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.Session (4)
Microsoft.AspNetCore.SignalR.Client.Core (24)
HubConnection.cs (17)
960var cts = cancellationToken.CanBeCanceled ? CancellationTokenSource.CreateLinkedTokenSource(cancellationToken) : new CancellationTokenSource();
966private async IAsyncEnumerable<T> CastIAsyncEnumerable<T>(string methodName, object?[] args, CancellationTokenSource cts)
1094var cts = CancellationTokenSource.CreateLinkedTokenSource(connectionState.UploadStreamToken, cancellationToken);
1140private Task InvokeStreamMethod(MethodInfo methodInfo, Type[] genericTypes, ConnectionState connectionState, string streamId, object reader, CancellationTokenSource tokenSource)
1162private Task ReflectionSendStreamItems(MethodInfo methodInfo, ConnectionState connectionState, string streamId, object reader, CancellationTokenSource tokenSource)
1198private Task SendStreamItems<T>(ConnectionState connectionState, string streamId, ChannelReader<T> reader, CancellationTokenSource tokenSource)
1215private Task SendIAsyncEnumerableStreamItems<T>(ConnectionState connectionState, string streamId, IAsyncEnumerable<T> stream, CancellationTokenSource tokenSource)
1228private async Task SendStreamItemAsync(ConnectionState connectionState, string streamId, object? item, CancellationTokenSource tokenSource)
1234private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts)
1237using var _ = cts;
1819using var handshakeCts = new CancellationTokenSource(HandshakeTimeout);
1917using var uploadStreamSource = new CancellationTokenSource();
2593CancellationTokenSource? cts = null;
2604using var __ = cts;
2756public CancellationTokenSource StopCts { get; set; } = new CancellationTokenSource();
Microsoft.AspNetCore.SignalR.Core (18)
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Microsoft.AspNetCore.SpaProxy (4)
Microsoft.AspNetCore.SpaServices.Extensions (2)
Microsoft.AspNetCore.StaticAssets (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.Bcl.TimeProvider (6)
Microsoft.Build (5)
Microsoft.Build.Framework (2)
Microsoft.Build.Tasks.CodeAnalysis (5)
Microsoft.Build.Tasks.Core (14)
Microsoft.CodeAnalysis (7)
Microsoft.CodeAnalysis.Analyzers (16)
Microsoft.CodeAnalysis.AnalyzerUtilities (16)
Microsoft.CodeAnalysis.CodeStyle (16)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.Extensions.Package (2)
Microsoft.CodeAnalysis.Features (20)
Microsoft.CodeAnalysis.Features.ExternalAccess (3)
Microsoft.CodeAnalysis.ResxSourceGenerator (16)
Microsoft.CodeAnalysis.Workspaces (23)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (2)
Microsoft.Diagnostics.NETCore.Client (37)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Cli.Telemetry (4)
Microsoft.DotNet.HotReload.Watch (22)
Microsoft.Extensions.AI.Abstractions.Tests (15)
Microsoft.Extensions.AI.OpenAI.Tests (7)
Microsoft.Extensions.AI.Templates.Tests (1)
Microsoft.Extensions.AI.Tests (37)
Microsoft.Extensions.AsyncState (5)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Hybrid.Tests (7)
Microsoft.Extensions.Compliance.Abstractions (5)
Microsoft.Extensions.Configuration (1)
Microsoft.Extensions.DataIngestion.Tests (2)
Microsoft.Extensions.Diagnostics.ExceptionSummarization.Tests (2)
Microsoft.Extensions.Diagnostics.HealthChecks (6)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (5)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
Microsoft.Extensions.Diagnostics.Testing (3)
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Microsoft.Extensions.DotNetDeltaApplier (2)
Microsoft.Extensions.FileProviders.Physical (14)
Microsoft.Extensions.Hosting (7)
Microsoft.Extensions.Hosting.Abstractions (3)
Microsoft.Extensions.Hosting.Testing (9)
Microsoft.Extensions.Hosting.Testing.Tests (5)
Microsoft.Extensions.Http.Diagnostics (4)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Resilience (5)
Microsoft.Extensions.Http.Resilience.Tests (2)
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.Logging.EventSource (3)
Microsoft.Extensions.ML (4)
Microsoft.Extensions.Primitives (1)
Microsoft.Extensions.ServiceDiscovery (1)
Microsoft.Extensions.ServiceDiscovery.Dns (12)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (2)
Microsoft.Extensions.Telemetry (5)
Microsoft.Extensions.Telemetry.Abstractions (5)
Microsoft.Extensions.TimeProvider.Testing.Tests (4)
Microsoft.JSInterop (11)
Microsoft.Maui (1)
Microsoft.Maui.Controls (2)
Microsoft.Maui.Essentials (2)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (4)
Microsoft.ML.AutoML.Tests (6)
Microsoft.ML.Core (2)
Microsoft.ML.Maml (1)
Microsoft.ML.Sweeper (1)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.NET.Build.Containers (6)
Microsoft.NET.Build.Tasks (1)
Microsoft.NET.Sdk.Publish.Tasks (5)
Microsoft.NET.Sdk.Razor.Tasks (3)
Microsoft.TemplateEngine.Cli (3)
Microsoft.TemplateEngine.Edge (4)
Microsoft.TestPlatform.CommunicationUtilities (3)
Microsoft.TestPlatform.CrossPlatEngine (3)
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
Microsoft.TestPlatform.PlatformAbstractions (1)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (2)
Microsoft.VisualStudio.TestPlatform.Common (1)
MSBuild (1)
MSBuild.Coordinator (4)
mscorlib (1)
Nats.Backend (1)
netstandard (1)
NuGet.Build.Tasks (2)
NuGet.CommandLine.XPlat (2)
NuGet.PackageManagement (7)
NuGet.Protocol (14)
Roslyn.Diagnostics.Analyzers (16)
rzc (6)
Shared (5)
Shared.Tests (4)
Stress.AppHost (3)
System.Collections.Concurrent (13)
System.CommandLine (4)
System.ComponentModel.Annotations (4)
System.Data.Odbc (1)
System.Data.OleDb (1)
System.Diagnostics.DiagnosticSource (1)
System.Diagnostics.Process (4)
System.IO.Pipelines (9)
System.IO.Pipes (3)
System.IO.Ports (3)
System.Linq.Parallel (6)
System.Net.Http (38)
System\Net\Http\HttpClient.cs (22)
27private CancellationTokenSource _pendingRequestsCts;
188(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
262(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
338(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
481(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
530(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
536CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
598private void HandleFailure(Exception e, bool telemetryStarted, HttpResponseMessage? response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
659private static void FinishSend(HttpResponseMessage? response, CancellationTokenSource cts, bool disposeCts, bool telemetryStarted, bool responseContentTelemetryStarted)
702CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingRequestsCts, new CancellationTokenSource());
802private (CancellationTokenSource TokenSource, bool DisposeTokenSource, CancellationTokenSource PendingRequestsCts) PrepareCancellationTokenSource(CancellationToken cancellationToken)
814CancellationTokenSource pendingRequestsCts = _pendingRequestsCts;
819CancellationTokenSource cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, pendingRequestsCts.Token);
System.Net.Http.Json (3)
System.Net.Mail (4)
System.Net.NameResolution (4)
System.Net.Ping (1)
System.Net.Quic (8)
System.Net.Requests (1)
System.Net.Security (1)
System.Net.Sockets (2)
System.Net.WebSockets (1)
System.Private.CoreLib (100)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (66)
15/// <see cref="CancellationTokenSource"/> is used to instantiate a <see cref="CancellationToken"/> (via
28/// <summary>A <see cref="CancellationTokenSource"/> that's already canceled.</summary>
29internal static readonly CancellationTokenSource s_canceledSource = new CancellationTokenSource() { _state = States.NotifyingCompleteState };
30/// <summary>A <see cref="CancellationTokenSource"/> that's never canceled. This isn't enforced programmatically, only by usage. Do not cancel!</summary>
31internal static readonly CancellationTokenSource s_neverCanceledSource = new CancellationTokenSource();
33/// <summary>Delegate used with <see cref="Timer"/> to trigger cancellation of a <see cref="CancellationTokenSource"/>.</summary>
36((CancellationTokenSource)state!).NotifyCancellation(throwOnFirstException: false); // skip ThrowIfDisposed() check in Cancel()
40/// <summary>Whether this <see cref="CancellationTokenSource"/> has been disposed.</summary>
58/// <summary>Gets whether cancellation has been requested for this <see cref="CancellationTokenSource" />.</summary>
59/// <value>Whether cancellation has been requested for this <see cref="CancellationTokenSource" />.</value>
78/// <summary>Gets the <see cref="CancellationToken"/> associated with this <see cref="CancellationTokenSource"/>.</summary>
79/// <value>The <see cref="CancellationToken"/> associated with this <see cref="CancellationTokenSource"/>.</value>
122/// <summary>Initializes the <see cref="CancellationTokenSource"/>.</summary>
126/// Constructs a <see cref="CancellationTokenSource"/> that will be canceled after a specified time span.
128/// <param name="delay">The time span to wait before canceling this <see cref="CancellationTokenSource"/></param>
135/// the constructed <see cref="CancellationTokenSource"/> is canceled, if it has
140/// <see cref="CancellationTokenSource"/>, if it has not been
148/// <summary>Initializes a new instance of the <see cref="CancellationTokenSource"/> class that will be canceled after the specified <see cref="TimeSpan"/>.</summary>
149/// <param name="delay">The time interval to wait before canceling this <see cref="CancellationTokenSource"/>.</param>
155/// the constructed <see cref="CancellationTokenSource"/> is canceled, if it has
157/// <see cref="CancellationTokenSource"/>, if it has not been canceled already.
172/// Constructs a <see cref="CancellationTokenSource"/> that will be canceled after a specified time span.
174/// <param name="millisecondsDelay">The time span to wait before canceling this <see cref="CancellationTokenSource"/></param>
181/// the constructed <see cref="CancellationTokenSource"/> is canceled (if it has
186/// <see cref="CancellationTokenSource"/>, if it has not been
249/// <exception cref="ObjectDisposedException">This <see cref="CancellationTokenSource"/> has been disposed.</exception>
275/// <exception cref="ObjectDisposedException">This <see cref="CancellationTokenSource"/> has been disposed.</exception>
304/// <exception cref="ObjectDisposedException">This <see cref="CancellationTokenSource"/> has been disposed.</exception>
345((CancellationTokenSource)s!).ExecuteCallbackHandlers(throwOnFirstException: false);
357/// <summary>Schedules a Cancel operation on this <see cref="CancellationTokenSource"/>.</summary>
358/// <param name="delay">The time span to wait before canceling this <see cref="CancellationTokenSource"/>.
361/// cref="CancellationTokenSource"/> has been disposed.
369/// this <see cref="CancellationTokenSource"/> is canceled, if it has
374/// <see cref="CancellationTokenSource"/>, if it has not been canceled already.
389/// Schedules a Cancel operation on this <see cref="CancellationTokenSource"/>.
392/// cref="CancellationTokenSource"/>.
395/// cref="CancellationTokenSource"/> has been disposed.
403/// this <see cref="CancellationTokenSource"/> is canceled, if it has
408/// <see cref="CancellationTokenSource"/>, if it has not been
463/// Attempts to reset the <see cref="CancellationTokenSource"/> to be used for an unrelated operation.
466/// true if the <see cref="CancellationTokenSource"/> has not had cancellation requested and could
470/// <see cref="TryReset"/> is intended to be used by the sole owner of the <see cref="CancellationTokenSource"/>
471/// when it is known that the operation with which the <see cref="CancellationTokenSource"/> was used has
474/// <see cref="CancellationTokenSource"/>; however, if any component still holds a reference to this
475/// <see cref="CancellationTokenSource"/> either directly or indirectly via a <see cref="CancellationToken"/>
509/// <summary>Releases the resources used by this <see cref="CancellationTokenSource" />.</summary>
518/// Releases the unmanaged resources used by the <see cref="CancellationTokenSource" /> class and optionally releases the managed resources.
835/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
840/// <returns>A <see cref="CancellationTokenSource"/> that is linked
842public static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token1, CancellationToken token2) =>
845(CancellationTokenSource)new Linked1CancellationTokenSource(token1);
848/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
852/// <returns>A <see cref="CancellationTokenSource"/> that is linked to the source token.</returns>
853public static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token) =>
857/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
861/// <returns>A <see cref="CancellationTokenSource"/> that is linked to the source tokens.</returns>
863public static CancellationTokenSource CreateLinkedTokenSource(params CancellationToken[] tokens)
870/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
874/// <returns>A <see cref="CancellationTokenSource"/> that is linked to the source tokens.</returns>
875public static CancellationTokenSource CreateLinkedTokenSource(params ReadOnlySpan<CancellationToken> tokens)
938Debug.Assert(s is CancellationTokenSource, $"Expected {typeof(CancellationTokenSource)}, got {s}");
939((CancellationTokenSource)s).NotifyCancellation(throwOnFirstException: false); // skip ThrowIfDisposed() check in Cancel()
980private static void Invoke(Delegate d, object? state, CancellationTokenSource source)
1002public readonly CancellationTokenSource Source;
1023public Registrations(CancellationTokenSource source) => Source = source;
System.Runtime (1)
System.Security.Cryptography (1)
System.ServiceModel.Http (2)
System.ServiceModel.Primitives (3)
System.Threading.Tasks (1)
System.Threading.Tasks.Dataflow (6)
System.Threading.Tasks.Parallel (18)
System.Windows.Extensions (2)
System.Windows.Forms.Primitives (1)
Testing.Tests (15)
vbc (2)
VBCSCompiler (7)
vstest.console (1)
vstest.console.arm64 (1)