5 types derived from CancellationTokenSource
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
System.Private.CoreLib (3)
883 instantiations of CancellationTokenSource
AnalyzerRunner (1)
ApiExplorerWebSite (2)
aspire (1)
Aspire.Cli.Tests (2)
Aspire.Components.Common.TestUtilities (1)
Aspire.Dashboard (14)
Aspire.Dashboard.Components.Tests (1)
Aspire.Dashboard.Tests (8)
Aspire.EndToEnd.Tests (2)
Aspire.Hosting (10)
Aspire.Hosting.Azure.Tests (18)
Aspire.Hosting.Containers.Tests (1)
Aspire.Hosting.Garnet.Tests (3)
Aspire.Hosting.Kafka.Tests (3)
Aspire.Hosting.MongoDB.Tests (5)
Aspire.Hosting.MySql.Tests (12)
Aspire.Hosting.Nats.Tests (3)
Aspire.Hosting.NodeJs.Tests (4)
Aspire.Hosting.Oracle.Tests (5)
Aspire.Hosting.PostgreSQL.Tests (10)
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (2)
Aspire.Hosting.Redis.Tests (5)
Aspire.Hosting.SqlServer.Tests (7)
Aspire.Hosting.Testing (3)
Aspire.Hosting.Testing.Tests (7)
Aspire.Hosting.Tests (31)
Aspire.Hosting.Valkey.Tests (2)
Aspire.Hosting.Yarp.Tests (1)
Aspire.MongoDB.Driver.Tests (1)
Aspire.MongoDB.Driver.v3.Tests (1)
Aspire.Playground.Tests (2)
Aspire.Templates.Tests (3)
ClientSample (1)
CustomResources.AppHost (1)
dotnet-svcutil-lib (8)
GenerateDocumentationAndConfigFiles (2)
HelixTestRunner (8)
HtmlGenerationWebSite (1)
http2cat (1)
HttpStress (2)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IIS.Tests (2)
IISExpress.FunctionalTests (1)
InMemory.FunctionalTests (10)
InProcessWebSite (1)
IntegrationTestsWebsite (1)
Interop.FunctionalTests (9)
InteropClient (2)
InteropTests (2)
Metrics (4)
Metrics.Legacy (4)
Microsoft.AspNetCore.Components (2)
Microsoft.AspNetCore.Components.Endpoints (4)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Server.Tests (4)
Microsoft.AspNetCore.Components.Tests (2)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
Microsoft.AspNetCore.Connections.Abstractions (1)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.DataProtection.Tests (14)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
Microsoft.AspNetCore.Hosting (5)
Microsoft.AspNetCore.Hosting.Tests (5)
Microsoft.AspNetCore.Http.Connections (8)
Microsoft.AspNetCore.Http.Connections.Client (4)
Microsoft.AspNetCore.Http.Connections.Tests (7)
Microsoft.AspNetCore.Http.Extensions.Tests (9)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Results.Tests (1)
Microsoft.AspNetCore.Http.Tests (2)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.InternalTesting.Tests (4)
Microsoft.AspNetCore.Mvc (2)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.Core.Test (8)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (9)
Microsoft.AspNetCore.Mvc.Razor.Test (3)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
Microsoft.AspNetCore.OpenApi.Tests (5)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.OutputCaching.Tests (6)
Microsoft.AspNetCore.ResponseCaching.Tests (3)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Routing.Tests (1)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (38)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.Session.Tests (3)
Microsoft.AspNetCore.SignalR.Client.Core (8)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (7)
Microsoft.AspNetCore.SignalR.Client.Tests (13)
Microsoft.AspNetCore.SignalR.Core (2)
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
Microsoft.AspNetCore.SignalR.Tests (16)
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
Microsoft.AspNetCore.StaticAssets (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.TestHost.Tests (5)
Microsoft.AspNetCore.WebSockets.ConformanceTests (2)
Microsoft.AspNetCore.WebSockets.Tests (1)
Microsoft.Bcl.TimeProvider (1)
Microsoft.Build (5)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Tasks.CodeAnalysis (1)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (1)
Microsoft.Build.Tasks.Core (5)
Microsoft.Build.Tasks.UnitTests (1)
Microsoft.CodeAnalysis.Analyzers (3)
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
Microsoft.CodeAnalysis.CodeStyle (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Microsoft.CodeAnalysis.EditorFeatures (19)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.InteractiveHost (3)
Microsoft.CodeAnalysis.LanguageServer (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (3)
Microsoft.CodeAnalysis.PublicApiAnalyzers (3)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.Threading.Package (1)
Microsoft.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces (10)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (23)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.ArcadeAzureIntegration (1)
Microsoft.DotNet.Build.Tasks.Feed (6)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Helix.Sdk (2)
Microsoft.Extensions.AI.Abstractions.Tests (6)
Microsoft.Extensions.AI.OpenAI.Tests (2)
Microsoft.Extensions.AI.Templates.Tests (1)
Microsoft.Extensions.AI.Tests (19)
Microsoft.Extensions.ApiDescription.Client.Tests (2)
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.Configuration.KeyPerFile.Tests (1)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (2)
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Microsoft.Extensions.FileProviders.Physical (4)
Microsoft.Extensions.Hosting (3)
Microsoft.Extensions.Hosting.Abstractions (1)
Microsoft.Extensions.Hosting.Testing.Tests (3)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Polly.Tests (1)
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.ObjectPool.Tests (1)
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 (7)
Microsoft.JSInterop.Tests (4)
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.VisualBasic.Forms (2)
Microsoft.VisualBasic.Forms.Tests (1)
Microsoft.VisualBasic.Tests (1)
Microsoft.VisualStudio.IntegrationTest.Setup (1)
Microsoft.VisualStudio.LanguageServices (10)
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (13)
MSBuild (1)
Nats.Backend (1)
RazorBuildWebSite (3)
Roslyn.Diagnostics.Analyzers (3)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (3)
RunTests (1)
Shared (1)
Sockets.FunctionalTests (1)
Stress.AppHost (1)
System.Collections.Concurrent (2)
System.Data.Odbc (1)
System.Diagnostics.DiagnosticSource (1)
System.Diagnostics.Process (2)
System.IO.FileSystem.Watcher (1)
System.IO.Pipelines (2)
System.IO.Pipes (1)
System.IO.Ports (1)
System.Linq.Parallel (4)
System.Net.Http (9)
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.Net.WebSockets.Client (1)
System.Private.CoreLib (4)
System.Security.Cryptography (1)
System.Threading.Tasks.Dataflow (2)
System.Threading.Tasks.Parallel (1)
System.Windows.Forms.Tests (1)
Templates.Blazor.Tests (2)
Templates.Blazor.WebAssembly.Auth.Tests (2)
Templates.Blazor.WebAssembly.Tests (2)
Templates.Mvc.Tests (2)
Templates.Tests (2)
Test.Utilities (2)
Text.Analyzers (3)
VBCSCompiler (3)
VBCSCompiler.UnitTests (2)
Wasm.Performance.Driver (2)
1678 references to CancellationTokenSource
AnalyzerRunner (1)
ApiExplorerWebSite (2)
aspire (3)
Aspire.Cli.Tests (2)
Aspire.Components.Common.TestUtilities (1)
Aspire.Dashboard (29)
Aspire.Dashboard.Components.Tests (2)
Aspire.Dashboard.Tests (9)
Aspire.EndToEnd.Tests (2)
Aspire.Hosting (43)
Aspire.Hosting.Azure.Tests (18)
Aspire.Hosting.Containers.Tests (1)
Aspire.Hosting.Garnet.Tests (3)
Aspire.Hosting.Kafka.Tests (4)
Aspire.Hosting.MongoDB.Tests (5)
Aspire.Hosting.MySql.Tests (13)
Aspire.Hosting.Nats.Tests (3)
Aspire.Hosting.NodeJs.Tests (5)
Aspire.Hosting.Oracle.Tests (5)
Aspire.Hosting.PostgreSQL.Tests (11)
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (3)
Aspire.Hosting.Redis.Tests (5)
Aspire.Hosting.SqlServer.Tests (7)
Aspire.Hosting.Testing (11)
Aspire.Hosting.Testing.Tests (11)
Aspire.Hosting.Tests (83)
Aspire.Hosting.Valkey.Tests (3)
Aspire.Hosting.Yarp.Tests (1)
Aspire.MongoDB.Driver.Tests (1)
Aspire.MongoDB.Driver.v3.Tests (1)
Aspire.Playground.Tests (7)
Aspire.Templates.Tests (3)
BuildActionTelemetryTable (2)
ClientSample (1)
CodeStyleConfigFileGenerator (2)
csc (2)
CustomResources.AppHost (1)
dotnet-svcutil-lib (9)
GenerateDocumentationAndConfigFiles (13)
HelixTestRunner (2)
HtmlGenerationWebSite (3)
http2cat (1)
HttpStress (2)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IIS.Tests (2)
IISExpress.FunctionalTests (1)
Infrastructure.Common (1)
InMemory.FunctionalTests (10)
InProcessWebSite (1)
IntegrationTestsWebsite (2)
Interop.FunctionalTests (9)
InteropClient (2)
InteropTests (2)
Metrics (15)
Metrics.Legacy (15)
Microsoft.AspNetCore.Components (3)
Microsoft.AspNetCore.Components.Endpoints (4)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.Server (13)
Microsoft.AspNetCore.Components.Server.Tests (3)
Microsoft.AspNetCore.Components.Tests (2)
Microsoft.AspNetCore.Components.Web (5)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
Microsoft.AspNetCore.Connections.Abstractions (2)
Microsoft.AspNetCore.DataProtection (2)
Microsoft.AspNetCore.DataProtection.Tests (14)
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
Microsoft.AspNetCore.Hosting (11)
Microsoft.AspNetCore.Hosting.Tests (5)
Microsoft.AspNetCore.Http (9)
Microsoft.AspNetCore.Http.Connections (14)
Microsoft.AspNetCore.Http.Connections.Client (4)
Microsoft.AspNetCore.Http.Connections.Tests (9)
Microsoft.AspNetCore.Http.Extensions.Tests (9)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Results.Tests (1)
Microsoft.AspNetCore.Http.Tests (4)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.InternalTesting (10)
Microsoft.AspNetCore.InternalTesting.Tests (4)
Microsoft.AspNetCore.Mvc (2)
Microsoft.AspNetCore.Mvc.Core (4)
Microsoft.AspNetCore.Mvc.Core.Test (8)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (9)
Microsoft.AspNetCore.Mvc.Razor.Test (3)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
Microsoft.AspNetCore.OpenApi.Tests (5)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.OutputCaching.Tests (6)
Microsoft.AspNetCore.ResponseCaching.Tests (3)
Microsoft.AspNetCore.Routing (3)
Microsoft.AspNetCore.Routing.Tests (2)
Microsoft.AspNetCore.Server.HttpSys (3)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (30)
Microsoft.AspNetCore.Server.IIS (3)
Microsoft.AspNetCore.Server.IntegrationTesting (4)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
Microsoft.AspNetCore.Server.Kestrel.Core (9)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.Session (4)
Microsoft.AspNetCore.Session.Tests (3)
Microsoft.AspNetCore.SignalR.Client.Core (20)
HubConnection.cs (14)
674var cts = cancellationToken.CanBeCanceled ? CancellationTokenSource.CreateLinkedTokenSource(cancellationToken) : new CancellationTokenSource();
680private async IAsyncEnumerable<T> CastIAsyncEnumerable<T>(string methodName, object?[] args, CancellationTokenSource cts)
834var cts = CancellationTokenSource.CreateLinkedTokenSource(connectionState.UploadStreamToken, cancellationToken);
876private void InvokeStreamMethod(MethodInfo methodInfo, Type[] genericTypes, ConnectionState connectionState, string streamId, object reader, CancellationTokenSource tokenSource)
937private Task SendStreamItems<T>(ConnectionState connectionState, string streamId, ChannelReader<T> reader, CancellationTokenSource tokenSource)
954private Task SendIAsyncEnumerableStreamItems<T>(ConnectionState connectionState, string streamId, IAsyncEnumerable<T> stream, CancellationTokenSource tokenSource)
967private async Task SendStreamItemAsync(ConnectionState connectionState, string streamId, object? item, CancellationTokenSource tokenSource)
973private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts)
976using var _ = cts;
1511using var handshakeCts = new CancellationTokenSource(HandshakeTimeout);
1609using var uploadStreamSource = new CancellationTokenSource();
2453public CancellationTokenSource StopCts { get; set; } = new CancellationTokenSource();
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (7)
Microsoft.AspNetCore.SignalR.Client.Tests (15)
Microsoft.AspNetCore.SignalR.Core (16)
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Microsoft.AspNetCore.SignalR.Tests (18)
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
Microsoft.AspNetCore.SpaProxy (4)
Microsoft.AspNetCore.SpaServices.Extensions (2)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
Microsoft.AspNetCore.StaticAssets (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.TestHost.Tests (5)
Microsoft.AspNetCore.WebSockets.ConformanceTests (3)
Microsoft.AspNetCore.WebSockets.Tests (1)
Microsoft.Bcl.TimeProvider (6)
Microsoft.Build (5)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Tasks.CodeAnalysis (5)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (5)
Microsoft.Build.Tasks.Core (8)
Microsoft.Build.Tasks.UnitTests (1)
Microsoft.CodeAnalysis (7)
Microsoft.CodeAnalysis.Analyzers (14)
Microsoft.CodeAnalysis.AnalyzerUtilities (14)
Microsoft.CodeAnalysis.BannedApiAnalyzers (14)
Microsoft.CodeAnalysis.CodeStyle (14)
Microsoft.CodeAnalysis.Collections.Package (2)
Microsoft.CodeAnalysis.Contracts.Package (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Microsoft.CodeAnalysis.Debugging.Package (2)
Microsoft.CodeAnalysis.EditorFeatures (28)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Microsoft.CodeAnalysis.Extensions.Package (2)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (3)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
Microsoft.CodeAnalysis.Features (23)
Microsoft.CodeAnalysis.InteractiveHost (14)
Microsoft.CodeAnalysis.LanguageServer (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (13)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (11)
69private readonly CancellationTokenSource _cancelSource = new();
195var concurrentlyExecutingTasks = new ConcurrentDictionary<Task, CancellationTokenSource>();
216CancellationTokenSource? currentWorkCts = null;
223currentWorkCts = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken, cancellationToken);
303/// Reflection invokes <see cref="ProcessQueueCoreAsync{TRequest, TResponse}(IQueueItem{TRequestContext}, IMethodHandler, RequestHandlerMetadata, ConcurrentDictionary{Task, CancellationTokenSource}, CancellationTokenSource?, CancellationToken)"/>
311ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
312CancellationTokenSource? currentWorkCts,
333ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
334CancellationTokenSource? currentWorkCts,
394if (!concurrentlyExecutingTasks.TryRemove(t, out var concurrentlyExecutingTaskCts))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (14)
Microsoft.CodeAnalysis.PooledObjects.Package (2)
Microsoft.CodeAnalysis.PublicApiAnalyzers (14)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Microsoft.CodeAnalysis.Remote.Workspaces (2)
Microsoft.CodeAnalysis.ResxSourceGenerator (14)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.Threading.Package (8)
Microsoft.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces (24)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (23)
Microsoft.CommonLanguageServerProtocol.Framework.Package (13)
RequestExecutionQueue.cs (11)
69private readonly CancellationTokenSource _cancelSource = new();
195var concurrentlyExecutingTasks = new ConcurrentDictionary<Task, CancellationTokenSource>();
216CancellationTokenSource? currentWorkCts = null;
223currentWorkCts = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken, cancellationToken);
303/// Reflection invokes <see cref="ProcessQueueCoreAsync{TRequest, TResponse}(IQueueItem{TRequestContext}, IMethodHandler, RequestHandlerMetadata, ConcurrentDictionary{Task, CancellationTokenSource}, CancellationTokenSource?, CancellationToken)"/>
311ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
312CancellationTokenSource? currentWorkCts,
333ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
334CancellationTokenSource? currentWorkCts,
394if (!concurrentlyExecutingTasks.TryRemove(t, out var concurrentlyExecutingTaskCts))
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.ArcadeAzureIntegration (1)
Microsoft.DotNet.Build.Tasks.Feed (6)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Helix.Sdk (2)
Microsoft.DotNet.Internal.SymbolHelper (2)
Microsoft.DotNet.XUnitExtensions (4)
Microsoft.Extensions.AI.Abstractions.Tests (6)
Microsoft.Extensions.AI.OpenAI.Tests (2)
Microsoft.Extensions.AI.Templates.Tests (1)
Microsoft.Extensions.AI.Tests (19)
Microsoft.Extensions.ApiDescription.Client.Tests (2)
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.Configuration.KeyPerFile.Tests (1)
Microsoft.Extensions.Diagnostics.HealthChecks (6)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (5)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (2)
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Microsoft.Extensions.FileProviders.Physical (13)
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.Polly.Tests (1)
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.ObjectPool.Tests (1)
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 (7)
Microsoft.JSInterop.Tests (4)
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.TestUtilities (1)
Microsoft.VisualBasic.Tests (1)
Microsoft.VisualStudio.IntegrationTest.Setup (1)
Microsoft.VisualStudio.LanguageServices (9)
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
Microsoft.VisualStudio.LanguageServices.CSharp (6)
MSBuild (1)
mscorlib (1)
Nats.Backend (1)
netstandard (1)
RazorBuildWebSite (3)
Replay (4)
Roslyn.Diagnostics.Analyzers (14)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (3)
RunTests (3)
SemanticSearch.BuildTask (2)
Shared (5)
Shared.Tests (4)
Sockets.FunctionalTests (1)
Stress.AppHost (1)
System.Collections.Concurrent (13)
System.Data.Odbc (1)
System.Diagnostics.DiagnosticSource (1)
System.Diagnostics.Process (2)
System.IO.FileSystem.Watcher (3)
System.IO.Pipelines (9)
System.IO.Pipes (3)
System.IO.Ports (3)
System.Linq.Parallel (6)
System.Net.Http (37)
System\Net\Http\HttpClient.cs (22)
27private CancellationTokenSource _pendingRequestsCts;
183(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
255(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
329(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
460(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
509(CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts) = PrepareCancellationTokenSource(cancellationToken);
515CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
577private void HandleFailure(Exception e, bool telemetryStarted, HttpResponseMessage? response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
638private static void FinishSend(HttpResponseMessage? response, CancellationTokenSource cts, bool disposeCts, bool telemetryStarted, bool responseContentTelemetryStarted)
681CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingRequestsCts, new CancellationTokenSource());
781private (CancellationTokenSource TokenSource, bool DisposeTokenSource, CancellationTokenSource PendingRequestsCts) PrepareCancellationTokenSource(CancellationToken cancellationToken)
793CancellationTokenSource pendingRequestsCts = _pendingRequestsCts;
798CancellationTokenSource cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, pendingRequestsCts.Token);
System.Net.Http.Json (3)
System.Net.Mail (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.Net.WebSockets.Client (4)
System.Private.CoreLib (100)
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.
844/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
849/// <returns>A <see cref="CancellationTokenSource"/> that is linked
851public static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token1, CancellationToken token2) =>
854(CancellationTokenSource)new Linked1CancellationTokenSource(token1);
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 token.</returns>
862public static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token) =>
866/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
870/// <returns>A <see cref="CancellationTokenSource"/> that is linked to the source tokens.</returns>
872public static CancellationTokenSource CreateLinkedTokenSource(params CancellationToken[] tokens)
879/// Creates a <see cref="CancellationTokenSource"/> that will be in the canceled state
883/// <returns>A <see cref="CancellationTokenSource"/> that is linked to the source tokens.</returns>
884public static CancellationTokenSource CreateLinkedTokenSource(params ReadOnlySpan<CancellationToken> tokens)
947Debug.Assert(s is CancellationTokenSource, $"Expected {typeof(CancellationTokenSource)}, got {s}");
948((CancellationTokenSource)s).NotifyCancellation(throwOnFirstException: false); // skip ThrowIfDisposed() check in Cancel()
989private static void Invoke(Delegate d, object? state, CancellationTokenSource source)
1011public readonly CancellationTokenSource Source;
1032public Registrations(CancellationTokenSource source) => Source = source;
System.Runtime (1)
System.Security.Cryptography (1)
System.Threading.Tasks (1)
System.Threading.Tasks.Dataflow (6)
System.Threading.Tasks.Parallel (18)
System.Windows.Forms.Tests (1)
Templates.Blazor.Tests (2)
Templates.Blazor.WebAssembly.Auth.Tests (2)
Templates.Blazor.WebAssembly.Tests (2)
Templates.Mvc.Tests (2)
Templates.Tests (2)
Test.Utilities (13)
Text.Analyzers (14)
vbc (2)
VBCSCompiler (7)
VBCSCompiler.UnitTests (4)
Wasm.Performance.Driver (1)
Xunit.NetCore.Extensions (4)