665 references to CancellationTokenSource
aspire (5)
Backchannel\ResourceSnapshotWatcher.cs (1)
16private readonly CancellationTokenSource _cts = new();
ConsoleCancellationManager.cs (2)
66private readonly CancellationTokenSource _cts = new(); 67private readonly CancellationTokenSource _gracefulCts = new();
Interaction\ExtensionInteractionService.cs (1)
34private readonly CancellationTokenSource _cts = new();
src\Shared\ParentProcessLivenessMonitor.cs (1)
15private readonly CancellationTokenSource _stopCts = new();
aspire-managed (3)
Program.cs (2)
47using var shutdownCts = new CancellationTokenSource(); 73using var operationCts = new CancellationTokenSource();
src\Shared\ParentProcessLivenessMonitor.cs (1)
15private readonly CancellationTokenSource _stopCts = new();
Aspire.Acquisition.Tests (2)
Scripts\Common\ScriptHostFixture.cs (1)
57_cts = new CancellationTokenSource();
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
84CancellationTokenSource cts = new();
Aspire.Cli.Tests (76)
Acquisition\PeerInstallProbeTests.cs (1)
396using var cts = new CancellationTokenSource();
Agents\AgentEnvironmentApplicatorTests.cs (1)
31using var cts = new CancellationTokenSource();
Agents\AspireSkillsInstallerTests.cs (3)
921using var cancellationTokenSource = new CancellationTokenSource(); 1157using var cancellationTokenSource = new CancellationTokenSource(); 1539using var cancellationTokenSource = new CancellationTokenSource();
Backchannel\AppHostAuxiliaryBackchannelTests.cs (1)
38using var watchCancellation = new CancellationTokenSource();
Backchannel\ExtensionBackchannelTests.cs (1)
104using var firstConnectorCts = new CancellationTokenSource();
Certificates\CertificateServiceTests.cs (1)
306using var cancellationTokenSource = new CancellationTokenSource();
Certificates\UnixCertificateManagerTests.cs (1)
28using var cancellationTokenSource = new CancellationTokenSource();
Commands\AgentMcpCommandTests.cs (1)
31var cts = new CancellationTokenSource();
Commands\AppHostLauncherTests.cs (3)
705using var cts = new CancellationTokenSource(); 771using var cts = new CancellationTokenSource(); 811using var cts = new CancellationTokenSource();
Commands\BaseCommandTests.cs (2)
458using var cts = new CancellationTokenSource(); 497using var cts = new CancellationTokenSource();
Commands\DashboardRunCommandTests.cs (1)
462using var cts = new CancellationTokenSource();
Commands\DescribeCommandTests.cs (1)
409using var cts = new CancellationTokenSource();
Commands\LogsCommandTests.cs (1)
962using var cts = new CancellationTokenSource();
Commands\LsCommandTests.cs (2)
463using var cancellationTokenSource = new CancellationTokenSource(); 670using var cancellationTokenSource = new CancellationTokenSource();
Commands\PsCommandTests.cs (1)
582using var cancellationTokenSource = new CancellationTokenSource();
Commands\RunCommandTests.cs (20)
368using var cts = new CancellationTokenSource(); 625using var cts = new CancellationTokenSource(); 1536using var cts = new CancellationTokenSource(); 1597using var cts = new CancellationTokenSource(); 1598using var unrelatedCts = new CancellationTokenSource(); 2052using var cts = new CancellationTokenSource(); 2124using var cts = new CancellationTokenSource(); 2375using var cts = new CancellationTokenSource(); 2486using var cts = new CancellationTokenSource(); 2592using var cts = new CancellationTokenSource(); 2662using var cts = new CancellationTokenSource(); 2731using var cts = new CancellationTokenSource(); 2922using var cts = new CancellationTokenSource(); 2981using var cts = new CancellationTokenSource(); 3093using var cts = new CancellationTokenSource(); 3152using var cts = new CancellationTokenSource(); 3559using var cts = new CancellationTokenSource(); 3640using var cts = new CancellationTokenSource(); 4098using var cts = new CancellationTokenSource(); 4171using var cts = new CancellationTokenSource();
DotNet\ProcessExecutionDetachedTests.cs (1)
157using var cts = new CancellationTokenSource();
DotNet\ProcessExecutionTests.cs (4)
170using var cts = new CancellationTokenSource(); 198using var cts = new CancellationTokenSource(); 229using var cts = new CancellationTokenSource(); 259using var cts = new CancellationTokenSource();
DotNetSdkInstallerTests.cs (1)
59using var cancellationTokenSource = new CancellationTokenSource();
Mcp\Docs\DocsFetcherTests.cs (1)
214using var cts = new CancellationTokenSource();
Mcp\Docs\DocsIndexServiceTests.cs (1)
826using var cts = new CancellationTokenSource();
Mcp\Docs\LlmsTxtParserTests.cs (1)
512var cts = new CancellationTokenSource();
NuGet\NuGetPackagePrefetcherTests.cs (1)
112using var stoppingCts = new CancellationTokenSource();
Processes\LauncherLivenessMonitorTests.cs (4)
20using var runCts = new CancellationTokenSource(); 33using var runCts = new CancellationTokenSource(); 60using var runCts = new CancellationTokenSource(); 79using var runCts = new CancellationTokenSource();
Projects\AppHostCandidateFinderTests.cs (2)
494using var cancellationTokenSource = new CancellationTokenSource(); 507using var cancellationTokenSource = new CancellationTokenSource();
Projects\AppHostInfoResolverTests.cs (1)
156using var cancellationTokenSource = new CancellationTokenSource();
Projects\AppHostServerSessionTests.cs (5)
189using var stopCts = new CancellationTokenSource(); 218using var stopCts = new CancellationTokenSource(); 267using var stopCts = new CancellationTokenSource(); 313using var stopCts = new CancellationTokenSource(); 349using var stopCts = new CancellationTokenSource();
Projects\GuestRuntimeTests.cs (1)
908using var cts = new CancellationTokenSource();
Projects\PrebuiltAppHostServerTests.cs (1)
1452using var cancellation = new CancellationTokenSource();
Projects\ProcessGuestLauncherTests.cs (5)
63using var cts = new CancellationTokenSource(); 99using var cts = new CancellationTokenSource(); 151using var cts = new CancellationTokenSource(); 210using var cts = new CancellationTokenSource(); 276using var cts = new CancellationTokenSource();
Projects\RunningInstanceManagerTests.cs (1)
66private readonly CancellationTokenSource _cts = new();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
TestServices\TestGracefulShutdownWindow.cs (1)
16private readonly CancellationTokenSource _cts = new();
Utils\DcpConnectionHealthCheckTests.cs (1)
90using var cancellation = new CancellationTokenSource();
Utils\DevCertsCheckTests.cs (1)
600using var cancellationTokenSource = new CancellationTokenSource();
Utils\EnvironmentCheckerTests.cs (1)
102using var cancellationTokenSource = new CancellationTokenSource();
Aspire.Dashboard (25)
Components\Controls\ApplicationName.razor.cs (1)
36_disposalCts = new CancellationTokenSource();
Components\Controls\Chart\ChartBase.cs (1)
22private readonly CancellationTokenSource _cts = new();
Components\Controls\Chart\ChartContainer.razor.cs (1)
23private readonly CancellationTokenSource _disposeCts = new();
Components\Controls\SpanDetails.razor.cs (1)
86private readonly CancellationTokenSource _cts = new();
Components\Dialogs\ExemplarsDialog.razor.cs (1)
36private readonly CancellationTokenSource _cts = new();
Components\Dialogs\FilterDialog.razor.cs (1)
20private readonly CancellationTokenSource _disposeCts = new();
Components\Dialogs\GenAIVisualizerDialog.razor.cs (1)
28private readonly CancellationTokenSource _cts = new();
Components\Dialogs\InteractionsInputDialog.razor.cs (1)
37private readonly CancellationTokenSource _disposalCts = new();
Components\Dialogs\ManageDataDialog.razor.cs (1)
68private readonly CancellationTokenSource _cts = new();
Components\Interactions\InteractionsProvider.cs (1)
41private readonly CancellationTokenSource _cts = new();
Components\Pages\ConsoleLogs.razor.cs (4)
37private readonly CancellationTokenSource _cts = new(); 52_cts = new(); 139private readonly CancellationTokenSource _resourceSubscriptionCts = new(); 934_showNoLogsMessageCts = new();
Components\Pages\Resources.razor.cs (1)
107private readonly CancellationTokenSource _cts = new();
Components\Pages\StructuredLogs.razor.cs (1)
41private readonly CancellationTokenSource _cts = new();
Components\Pages\TraceDetail.razor.cs (1)
34private readonly CancellationTokenSource _cts = new();
Components\Pages\Traces.razor.cs (1)
32private readonly CancellationTokenSource _cts = new();
Model\DashboardCommandExecutor.cs (2)
103using var executeCommandCts = new CancellationTokenSource(); 148var closeToastCts = new CancellationTokenSource();
Model\ResourceOutgoingPeerResolver.cs (1)
42_watchContainersTokenSource = new();
Model\TraceLinkHelpers.cs (1)
48using var cts = new CancellationTokenSource();
ServiceClient\DashboardClient.cs (1)
57private readonly CancellationTokenSource _cts = new();
Utils\CallbackThrottler.cs (1)
24_cts = new CancellationTokenSource();
Utils\CancellationSeries.cs (1)
33var nextCts = new CancellationTokenSource();
Aspire.Dashboard.Components.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Dashboard.Tests (18)
ChannelExtensionsTests.cs (5)
35var cts = new CancellationTokenSource(); 57var cts = new CancellationTokenSource(); 81var cts = new CancellationTokenSource(); 105var cts = new CancellationTokenSource(); 149var cts = new CancellationTokenSource();
Integration\StartupTests.cs (1)
109using var cts = new CancellationTokenSource();
Model\DashboardClientTests.cs (3)
40var cts = new CancellationTokenSource(); 126var cts = new CancellationTokenSource(); 184var cts = new CancellationTokenSource();
Shared\TestHostApplicationLifetime.cs (3)
10private readonly CancellationTokenSource _started = new(); 11private readonly CancellationTokenSource _stopping = new(); 12private readonly CancellationTokenSource _stopped = new();
TelemetryRepositoryTests\SqliteTelemetryPersistenceTests.cs (1)
34using var cancellationSource = new CancellationTokenSource();
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (4)
446using var cts = new CancellationTokenSource(); 563using var cts = new CancellationTokenSource(); 658using var doneCts = new CancellationTokenSource(); 736using var doneCts = new CancellationTokenSource();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.EndToEnd.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
367CancellationTokenSource cts = new();
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
84CancellationTokenSource cts = new();
Aspire.Hosting (14)
ApplicationModel\ResourceLoggerService.cs (2)
23private readonly CancellationTokenSource _disposing = new(); 379private readonly CancellationTokenSource _logStreamCts = new();
ApplicationModel\ResourceNotificationService.cs (1)
30private readonly CancellationTokenSource _disposing = new();
Backchannel\AppHostRpcTarget.cs (1)
28private readonly CancellationTokenSource _shutdownCts = new();
Dashboard\DashboardServiceData.cs (1)
17private readonly CancellationTokenSource _cts = new();
Dcp\DcpExecutor.cs (2)
71private readonly CancellationTokenSource _shutdownCancellation = new(); 325var disposeCts = new CancellationTokenSource();
Dcp\DcpHost.cs (1)
39private readonly CancellationTokenSource _shutdownCts = new();
Dcp\DcpResourceWatcher.cs (1)
1018private readonly CancellationTokenSource _cancellation = new();
Dcp\ResourceLogSource.cs (1)
44ownedCts = new CancellationTokenSource();
Devcontainers\DevcontainerSettingsWriter.cs (1)
34private readonly CancellationTokenSource _processingCancellation = new();
Orchestrator\ApplicationOrchestrator.cs (1)
37private readonly CancellationTokenSource _shutdownCancellation = new();
Orchestrator\ParameterProcessor.cs (1)
83var cts = new CancellationTokenSource();
Pipelines\PipelineActivityReporter.cs (1)
23private readonly CancellationTokenSource _cancellationTokenSource = new();
Aspire.Hosting.Azure.Kusto.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Azure.Tests (3)
AzureEnvironmentResourceExtensionsTests.cs (2)
2335using var cts = new CancellationTokenSource(); 4282using var cts = new CancellationTokenSource();
DefaultAzurePrincipalProviderTests.cs (1)
116using var cts = new CancellationTokenSource();
Aspire.Hosting.Blazor (2)
BrowserDebuggerHelper.cs (2)
81var watcherCts = new CancellationTokenSource(); 168watcherCts = new CancellationTokenSource();
Aspire.Hosting.Blazor.Tests (3)
BrowserDebuggerHelperTests.cs (2)
101using var watcherCts = new CancellationTokenSource(); 126using var watcherCts = new CancellationTokenSource();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Browsers (3)
BrowserLogsCdpConnection.cs (1)
48private readonly CancellationTokenSource _disposeCts = new();
BrowserLogsRunningSession.cs (1)
92private readonly CancellationTokenSource _stopCts = new();
BrowserPageSession.cs (1)
39private readonly CancellationTokenSource _stopCts = new();
Aspire.Hosting.Browsers.Tests (4)
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnection.cs (1)
48private readonly CancellationTokenSource _disposeCts = new();
src\Aspire.Hosting.Browsers\BrowserLogsRunningSession.cs (1)
92private readonly CancellationTokenSource _stopCts = new();
src\Aspire.Hosting.Browsers\BrowserPageSession.cs (1)
39private readonly CancellationTokenSource _stopCts = new();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
AtsTypeScriptCodeGeneratorTests.cs (1)
2514using var cancellation = new CancellationTokenSource();
Aspire.Hosting.Containers.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.DevTunnels.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Dotnet.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.DotnetTool.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.EntityFrameworkCore.Tests (7)
EFCoreOperationExecutorTests.cs (7)
24using var cts = new CancellationTokenSource(); 41using var cts = new CancellationTokenSource(); 58using var cts = new CancellationTokenSource(); 73using var cts = new CancellationTokenSource(); 93using var cts = new CancellationTokenSource(); 110using var cts = new CancellationTokenSource(); 128using var cts = new CancellationTokenSource();
Aspire.Hosting.Foundry.Tests (2)
PromptAgentTests.cs (1)
95using var cts = new CancellationTokenSource();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.GitHub.Models.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.JavaScript.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Kafka.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Maui.Tests (2)
MauiBuildQueueTests.cs (2)
42var cts = new CancellationTokenSource(); 239using var cts = new CancellationTokenSource();
Aspire.Hosting.MySql.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.OpenAI.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.PostgreSQL.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.RabbitMQ.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Radius.Tests (3)
Deployment\RadCliDetectionTests.cs (1)
35using var cts = new CancellationTokenSource();
Secrets\SealedSecretApplyStepTests.cs (2)
542using var cts = new CancellationTokenSource(); 820using var cts = new CancellationTokenSource();
Aspire.Hosting.RemoteHost (2)
CancellationTokenRegistry.cs (2)
30var cts = new CancellationTokenSource(); 137var cts = new CancellationTokenSource();
Aspire.Hosting.RemoteHost.Tests (6)
AtsMarshallerTests.cs (2)
205using var cts = new CancellationTokenSource(); 221using var cts = new CancellationTokenSource();
CallbackProxyTests.cs (2)
192using var cts = new CancellationTokenSource(); 213using var cts = new CancellationTokenSource();
CancellationTokenRegistryTests.cs (1)
38using var cts = new CancellationTokenSource();
CapabilityDispatcherTests.cs (1)
315using var cts = new CancellationTokenSource();
Aspire.Hosting.Rust.Tests (2)
RustPublicApiTests.cs (2)
215using var cts = new CancellationTokenSource(); 513using var cts = new CancellationTokenSource();
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
28private readonly CancellationTokenSource _disposingCts = new();
Aspire.Hosting.Testing.Tests (4)
ResourceLoggerForwarderServiceTests.cs (3)
156private readonly CancellationTokenSource _startedCts = new(); 157private readonly CancellationTokenSource _stoppingCts = new(); 158private readonly CancellationTokenSource _stoppedCts = new();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Hosting.Tests (62)
Backchannel\AppHostRpcTargetCancellationTests.cs (6)
30using var cts = new CancellationTokenSource(); 50using var cts = new CancellationTokenSource(); 105using var cts = new CancellationTokenSource(); 124using var cts = new CancellationTokenSource(); 176using var cts = new CancellationTokenSource(); 195using var cts = new CancellationTokenSource();
Backchannel\AppHostRpcTargetUploadTests.cs (1)
147using var cancellationTokenSource = new CancellationTokenSource();
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (5)
979using var cts = new CancellationTokenSource(); 1091using var cts = new CancellationTokenSource(); 1507using var cancellationTokenSource = new CancellationTokenSource(); 1542using var cancellationTokenSource = new CancellationTokenSource(); 2112using var cts = new CancellationTokenSource();
Backchannel\GetTerminalInfoAsyncTests.cs (1)
398_cts = new CancellationTokenSource();
Dashboard\DashboardServiceDataTerminalTests.cs (3)
216public CancellationToken ApplicationStarted { get; } = new CancellationTokenSource().Token; 217public CancellationToken ApplicationStopped { get; } = new CancellationTokenSource().Token; 218public CancellationToken ApplicationStopping { get; } = new CancellationTokenSource().Token;
Dashboard\DashboardServiceTests.cs (6)
216var cts = new CancellationTokenSource(); 478var cts = new CancellationTokenSource(); 549var cts = new CancellationTokenSource(); 597var cts = new CancellationTokenSource(); 657var cts = new CancellationTokenSource(); 695var cts = new CancellationTokenSource();
Dashboard\ResourcePublisherTests.cs (5)
35CancellationTokenSource cts = new(); 88CancellationTokenSource cts = new(); 135CancellationTokenSource cts = new(); 156CancellationTokenSource cts = new(); 177CancellationTokenSource cts = new();
Dcp\DcpExecutorTests.cs (3)
1512var watchCts = new CancellationTokenSource(); 4635using var cts = new CancellationTokenSource(); 8348using var restartCancellation = new CancellationTokenSource();
DebugSupportExtensionsTests.cs (4)
77using var cts = new CancellationTokenSource(); 196using var cts = new CancellationTokenSource(); 215using var cts = new CancellationTokenSource(); 256using var cts = new CancellationTokenSource();
DistributedApplicationTests.cs (4)
77var cts = new CancellationTokenSource(); 122var cts = new CancellationTokenSource(); 442using var cts = new CancellationTokenSource(); 482using var cts = new CancellationTokenSource();
EndpointReferenceTests.cs (1)
173using var cts = new CancellationTokenSource();
ExecutionConfigurationGathererTests.cs (1)
659using var cts = new CancellationTokenSource();
Health\FriendlyHealthCheckErrorMessagesTests.cs (1)
202var cts = new CancellationTokenSource();
InteractionServiceTests.cs (5)
51var cts = new CancellationTokenSource(); 1222using var cts = new CancellationTokenSource(); 1256var cts = new CancellationTokenSource(); 1297var cts = new CancellationTokenSource(); 1404using var cancellationTokenSource = new CancellationTokenSource();
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (1)
244var stopCts = new CancellationTokenSource();
Publishing\ContainerRuntimeResolverTests.cs (1)
68using var cts = new CancellationTokenSource();
Publishing\PipelineActivityReporterTests.cs (1)
691using var cancellationTokenSource = new CancellationTokenSource();
ResourceNotificationTests.cs (6)
346using var cts = new CancellationTokenSource(); 825using var cts = new CancellationTokenSource(); 852using var cts = new CancellationTokenSource(); 894using var cts = new CancellationTokenSource(); 1397using var cts = new CancellationTokenSource(); 1430private readonly CancellationTokenSource _stoppingCts = new();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Utils\PeriodicRestartAsyncEnumerableTests.cs (2)
15using var cts = new CancellationTokenSource(); 39using var cts = new CancellationTokenSource();
ValueSnapshotTests.cs (2)
180using var cts = new CancellationTokenSource(); 192using var cts = new CancellationTokenSource();
WithHttpCommandTests.cs (1)
468using var cts = new CancellationTokenSource();
WithProcessCommandTests.cs (1)
1471using var cts = new CancellationTokenSource();
Aspire.Hosting.Valkey.Tests (1)
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Managed.Tests (2)
ParentProcessWatchdogTests.cs (2)
44using var operationCts = new CancellationTokenSource(); 61using var operationCts = new CancellationTokenSource();
Aspire.Playground.Tests (2)
ProjectSpecificTests.cs (1)
157CancellationTokenSource cts = new();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
Aspire.Templates.Tests (3)
TemplateTestsBase.cs (1)
186var cts = new CancellationTokenSource();
tests\Shared\TemplatesTesting\AspireProject.cs (1)
367CancellationTokenSource cts = new();
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
84CancellationTokenSource cts = new();
Aspire.TerminalHost (5)
DcpUpstreamAdapter.cs (1)
66private readonly CancellationTokenSource _disposeCts = new();
src\Shared\ParentProcessLivenessMonitor.cs (1)
15private readonly CancellationTokenSource _stopCts = new();
TerminalHostApp.cs (1)
33private readonly CancellationTokenSource _shutdownCts = new();
TerminalHostControlListener.cs (1)
22private readonly CancellationTokenSource _disposeCts = new();
TerminalHostProcessRunner.cs (1)
22using var forceExitCts = new CancellationTokenSource();
Aspire.TerminalHost.Tests (13)
TerminalHostAppTests.cs (12)
53using var hostCts = new CancellationTokenSource(); 76using var hostCts = new CancellationTokenSource(); 108using var hostCts = new CancellationTokenSource(); 136using var hostCts = new CancellationTokenSource(); 213using var hostCts = new CancellationTokenSource(); 266using var hostCts = new CancellationTokenSource(); 304using var hostCts = new CancellationTokenSource(); 390using var hostCts = new CancellationTokenSource(); 435using var hostCts = new CancellationTokenSource(); 472using var hostCts = new CancellationTokenSource(); 827using var hostCts = new CancellationTokenSource(); 864using var hostCts = new CancellationTokenSource();
tests\Shared\AsyncTestHelpers.cs (1)
43var cts = new CancellationTokenSource();
CustomResources.AppHost (1)
TestResource.cs (1)
37private readonly CancellationTokenSource _tokenSource = new();
dotnet (4)
Commands\Test\MTP\CtrlCCancellationManager.cs (1)
31private readonly CancellationTokenSource _cancellationTokenSource = new();
Commands\Test\MTP\Terminal\TestProgressStateAwareTerminal.cs (1)
14private readonly CancellationTokenSource _cts = new();
Commands\Test\MTP\TestApplication.cs (1)
58private readonly CancellationTokenSource _pipeCancellationTokenSource = new();
Commands\Test\MTP\TestRunPolicy.cs (1)
26private readonly CancellationTokenSource _cancellationTokenSource = new();
dotnet-svcutil-lib (3)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (1)
166using (CancellationTokenSource cts = new CancellationTokenSource())
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
892_httpSendCts = new CancellationTokenSource();
Tool.cs (1)
70var cancellationSource = new CancellationTokenSource();
dotnet-watch (1)
Watch\DotNetWatcher.cs (1)
92using var currentRunCancellationSource = new CancellationTokenSource();
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
Infrastructure.Tests (3)
PowerShellScripts\DownloadNativeArchivesTests.cs (1)
536_cts = new CancellationTokenSource();
PowerShellScripts\PowerShellCommand.cs (1)
58using CancellationTokenSource cts = new();
WorkflowScripts\NodeCommand.cs (1)
52using CancellationTokenSource cts = new();
Microsoft.Agents.AI.ProjectTemplates.Tests (1)
TestCommand.cs (1)
88using var timeoutCts = new CancellationTokenSource();
Microsoft.AspNetCore.Components (2)
NavigationManager.cs (1)
426var cts = new CancellationTokenSource();
Routing\Router.cs (1)
360_onNavigateCts = new CancellationTokenSource();
Microsoft.AspNetCore.Components.Endpoints (4)
Builder\RazorComponentEndpointDataSource.cs (2)
59_cancellationTokenSource = new CancellationTokenSource(); 173_cancellationTokenSource = new CancellationTokenSource();
DependencyInjection\HotReloadService.cs (2)
19private CancellationTokenSource _tokenSource = new(); 39var current = Interlocked.Exchange(ref _tokenSource, new CancellationTokenSource());
Microsoft.AspNetCore.Components.Forms (1)
EditContext.cs (1)
372var cts = new CancellationTokenSource();
Microsoft.AspNetCore.Components.Media (1)
MediaComponentBase.cs (1)
285_loadCts = new CancellationTokenSource();
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
527var thisLoadCts = _pendingDataLoadCancellationTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Components.Server (2)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (2)
19private CancellationTokenSource _loopCancellationTokenSource = new CancellationTokenSource(); 42_loopCancellationTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Components.Web (1)
Virtualization\Virtualize.cs (1)
955: new CancellationTokenSource();
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
TargetPickerUi.cs (1)
136var source = new CancellationTokenSource();
Microsoft.AspNetCore.Connections.Abstractions (1)
DefaultConnectionContext.cs (1)
27private readonly CancellationTokenSource _connectionClosedTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\XmlKeyManager.cs (1)
487Interlocked.Exchange(ref _cacheExpirationTokenSource, new CancellationTokenSource())?.Cancel();
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.AspNetCore.Hosting (4)
Internal\ApplicationLifetime.cs (3)
20private readonly CancellationTokenSource _startedSource = new CancellationTokenSource(); 21private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource(); 22private readonly CancellationTokenSource _stoppedSource = new CancellationTokenSource();
WebHostExtensions.cs (1)
91using (var cts = new CancellationTokenSource())
Microsoft.AspNetCore.Http.Connections (8)
Internal\HttpConnectionContext.cs (5)
122_connectionClosedTokenSource = new CancellationTokenSource(); 125_connectionCloseRequested = new CancellationTokenSource(); 851Cancellation = new CancellationTokenSource(); 853var timeoutSource = new CancellationTokenSource(); 1020_sendCts = new CancellationTokenSource();
Internal\HttpConnectionDispatcher.cs (1)
327connection.Cancellation ??= new CancellationTokenSource();
Internal\Transports\WebSocketsServerTransport.cs (2)
81using (var delayCts = new CancellationTokenSource()) 109using (var delayCts = new CancellationTokenSource())
Microsoft.AspNetCore.Http.Connections.Client (4)
Internal\LongPollingTransport.cs (1)
28private readonly CancellationTokenSource _transportCts = new CancellationTokenSource();
Internal\ServerSentEventsTransport.cs (2)
26private readonly CancellationTokenSource _transportCts = new CancellationTokenSource(); 27private readonly CancellationTokenSource _inputCts = new CancellationTokenSource();
Internal\WebSocketsTransport.cs (1)
315_stopCts = new CancellationTokenSource();
Microsoft.AspNetCore.HttpLogging (1)
FileLoggerProcessor.cs (1)
102_cancellationTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Mvc (2)
HotReloadService.cs (2)
21private CancellationTokenSource _tokenSource = new(); 78var current = Interlocked.Exchange(ref _tokenSource, new CancellationTokenSource());
Microsoft.AspNetCore.Mvc.Core (2)
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (1)
164_cancellationTokenSource = new CancellationTokenSource();
Routing\ActionEndpointDataSourceBase.cs (1)
134_cancellationTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Mvc.TagHelpers (1)
CacheTagHelper.cs (1)
92var tokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
31private readonly CancellationTokenSource _disposalCancellation = new();
Microsoft.AspNetCore.Routing (1)
CompositeEndpointDataSource.cs (1)
245var cts = new CancellationTokenSource();
Microsoft.AspNetCore.Server.HttpSys (1)
NativeInterop\DisconnectListener.cs (1)
59var cts = new CancellationTokenSource();
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.IHttpRequestLifetimeFeature.cs (1)
35_abortedCts = new CancellationTokenSource();
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
164var hostExitTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http\HttpProtocol.cs (1)
318_abortedCts = new CancellationTokenSource();
Internal\Http3\Http3Connection.cs (2)
52private CancellationTokenSource _acceptStreamsCts = new(); 374_acceptStreamsCts = new CancellationTokenSource();
Internal\Infrastructure\KestrelConnection.cs (1)
18private readonly CancellationTokenSource _connectionClosingCts = new CancellationTokenSource();
Internal\KestrelServerImpl.cs (1)
31private readonly CancellationTokenSource _stopCts = new CancellationTokenSource();
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (1)
Connection\DirectTlsConnection.cs (1)
36private readonly CancellationTokenSource _connectionClosedTokenSource = new();
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Internal\NamedPipeConnection.cs (1)
23private readonly CancellationTokenSource _connectionClosedTokenSource = new CancellationTokenSource();
Internal\NamedPipeConnectionListener.cs (1)
24private readonly CancellationTokenSource _listeningTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicConnectionContext.cs (1)
29private readonly CancellationTokenSource _connectionClosedTokenSource = new CancellationTokenSource();
Internal\QuicStreamContext.cs (1)
126_streamClosedTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Internal\SocketConnection.cs (1)
24private readonly CancellationTokenSource _connectionClosedTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.SignalR.Client.Core (7)
HubConnection.cs (7)
331_state.StopCts = new CancellationTokenSource(); 916_state.StopCts = new CancellationTokenSource(); 960var cts = cancellationToken.CanBeCanceled ? CancellationTokenSource.CreateLinkedTokenSource(cancellationToken) : new CancellationTokenSource(); 1917using var uploadStreamSource = new CancellationTokenSource(); 2088_state.StopCts = new CancellationTokenSource(); 2748StopCts = new CancellationTokenSource(); 2756public CancellationTokenSource StopCts { get; set; } = new CancellationTokenSource();
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (2)
30private readonly CancellationTokenSource _connectionAbortedTokenSource = new CancellationTokenSource(); 614using (var cts = new CancellationTokenSource())
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
HubLifetimeManagerTestBase.cs (1)
357var cts = new CancellationTokenSource();
Internal\TaskExtensions.cs (2)
24var cts = new CancellationTokenSource(); 48var cts = new CancellationTokenSource();
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TestClient.cs (1)
65_cts = new CancellationTokenSource();
Microsoft.AspNetCore.StaticAssets (2)
StaticAssetEndpointDataSource.cs (2)
38_cancellationTokenSource = new CancellationTokenSource(); 114_cancellationTokenSource = new CancellationTokenSource();
Microsoft.AspNetCore.TestHost (1)
RequestLifetimeFeature.cs (1)
10private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
Microsoft.Build (5)
BackEnd\BuildManager\BuildManager.cs (1)
611_executionCancellationTokenSource = new CancellationTokenSource();
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
1083_packetQueueDrainDelayCancellation = new CancellationTokenSource();
BackEnd\Components\Logging\LoggingService.cs (1)
1478_loggingEventProcessingCancellation = new CancellationTokenSource();
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
645_cancellationTokenSource = new CancellationTokenSource();
Logging\TerminalLogger\TerminalLogger.cs (1)
97private readonly CancellationTokenSource _cts = new();
Microsoft.Build.Tasks.CodeAnalysis (1)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (1)
541_sharedCompileCts = new CancellationTokenSource();
Microsoft.Build.Tasks.Core (7)
Copy.cs (1)
107private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
DownloadFile.cs (1)
24private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
FileIO\GetFileHash.cs (1)
126private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
FileIO\VerifyFileHash.cs (1)
80private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
TarDirectory.cs (1)
30private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
Untar.cs (1)
33private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
Unzip.cs (1)
33private readonly CancellationTokenSource _cancellationToken = new CancellationTokenSource();
Microsoft.CodeAnalysis.Analyzers (5)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
415public readonly CancellationTokenSource Cancellation = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
415public readonly CancellationTokenSource Cancellation = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
Microsoft.CodeAnalysis.CodeStyle (5)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
415public readonly CancellationTokenSource Cancellation = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
Microsoft.CodeAnalysis.Features (3)
EditAndContinue\DebuggingSession.cs (1)
35private readonly CancellationTokenSource _cancellationSource = new();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
30private readonly CancellationTokenSource _shutdownNotificationSource = new();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
234var source = new CancellationTokenSource();
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
415public readonly CancellationTokenSource Cancellation = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
Microsoft.CodeAnalysis.Workspaces (7)
Remote\IRemoteKeepAliveService.cs (1)
52private CancellationTokenSource KeepAliveTokenSource { get; } = new();
Shared\TestHooks\AsynchronousOperationListener.cs (2)
34_expeditedDelayCancellationTokenSource = new CancellationTokenSource(); 132var oldSource = Interlocked.Exchange(ref _expeditedDelayCancellationTokenSource, new CancellationTokenSource());
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Rpc\RpcClient.cs (1)
39private readonly CancellationTokenSource _shutdownTokenSource = new();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Rpc\RpcServer.cs (1)
44private readonly CancellationTokenSource _shutdownTokenSource = new();
Microsoft.Diagnostics.NETCore.Client (10)
DiagnosticsIpc\IpcServerTransport.cs (2)
99private readonly CancellationTokenSource _cancellation = new(); 166private readonly CancellationTokenSource _cancellation = new();
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (6)
228using CancellationTokenSource acceptTimeoutTokenSource = new(); 253using CancellationTokenSource connectTimeoutTokenSource = new(); 459using CancellationTokenSource connectTimeoutTokenSource = new(); 582using CancellationTokenSource connectTimeoutTokenSource = new(); 672using CancellationTokenSource connectTimeoutTokenSource = new(); 1462_cancelRouterTokenSource = new CancellationTokenSource();
ReversedServer\ReversedDiagnosticsServer.cs (2)
26private readonly CancellationTokenSource _disposalSource = new(); 273using CancellationTokenSource parseCancellationSource = new();
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
41private readonly CancellationTokenSource _cancellationSource = new CancellationTokenSource();
Microsoft.DotNet.Build.Tasks.Installers (1)
src\ExecWithRetries.cs (1)
52private CancellationTokenSource _cancelTokenSource = new CancellationTokenSource();
Microsoft.DotNet.Cli.Telemetry (2)
PersistentStorageLogExporter.cs (1)
102_drainCts = new CancellationTokenSource();
PersistentStorageTraceExporter.cs (1)
110_drainCts = new CancellationTokenSource();
Microsoft.DotNet.HotReload.Watch (8)
HotReload\HotReloadDotNetWatcher.cs (1)
85Interlocked.Exchange(ref forceRestartCancellationSource, new CancellationTokenSource())?.Dispose();
HotReload\RunningProjectsManager.cs (2)
60var processExitedSource = new CancellationTokenSource(); 61var processTerminationSource = new CancellationTokenSource();
Process\ProcessRunner.cs (2)
266using var cancellationSource = new CancellationTokenSource(); 304using var cancellationSource = new CancellationTokenSource();
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
49private readonly CancellationTokenSource _shutdownCancellationSource = new();
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\AbstractBrowserRefreshServer.cs (1)
154using var progressCancellationSource = new CancellationTokenSource();
UI\ShutdownHandler.cs (1)
10private readonly CancellationTokenSource _cancellationSource = new();
Microsoft.Extensions.AI.Abstractions.Tests (15)
ChatCompletion\ChatClientExtensionsTests.cs (4)
105using var cts = new CancellationTokenSource(); 132using var cts = new CancellationTokenSource(); 176using var cts = new CancellationTokenSource(); 216using var cts = new CancellationTokenSource();
ChatRouting\RoutingChatClientTests.cs (1)
25using var cancellationSource = new CancellationTokenSource();
Contents\DataContentTests.cs (3)
776using CancellationTokenSource cts = new(); 798using CancellationTokenSource cts = new(); 825using CancellationTokenSource cts = new();
Embeddings\DelegatingEmbeddingGeneratorTests.cs (1)
25using var cts = new CancellationTokenSource();
Image\ImageGeneratorTests.cs (1)
49using var cts = new CancellationTokenSource();
SpeechToText\SpeechToTextClientExtensionsTests.cs (1)
57using var cts = new CancellationTokenSource();
SpeechToText\SpeechToTextClientTests.cs (2)
19using var cts = new CancellationTokenSource(); 47using var cts = new CancellationTokenSource();
TextToSpeech\TextToSpeechClientTests.cs (2)
18using var cts = new CancellationTokenSource(); 42using var cts = new CancellationTokenSource();
Microsoft.Extensions.AI.OpenAI.Tests (7)
OpenAIRealtimeClientSessionTests.cs (2)
68using var cts = new CancellationTokenSource(); 88using var cts = new CancellationTokenSource();
OpenAIRealtimeClientTests.cs (1)
55using var cts = new CancellationTokenSource();
OpenAISpeechToTextClientTests.cs (2)
111using var cancellationTokenSource = new CancellationTokenSource(); 125using var cancellationTokenSource = new CancellationTokenSource();
OpenAITextToSpeechClientTests.cs (2)
224using var cancellationTokenSource = new CancellationTokenSource(); 237using var cancellationTokenSource = new CancellationTokenSource();
Microsoft.Extensions.AI.Templates.Tests (1)
TestCommand.cs (1)
88using var timeoutCts = new CancellationTokenSource();
Microsoft.Extensions.AI.Tests (37)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
39using CancellationTokenSource cts = new();
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (4)
1470using CancellationTokenSource cts = new(); 1546using CancellationTokenSource cts = new(); 1961using CancellationTokenSource cts = new(); 2049using CancellationTokenSource cts = new();
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
2209using CancellationTokenSource cts = new(); 2279using CancellationTokenSource cts = new();
ChatCompletion\UseDelegateChatClientTests.cs (4)
30using CancellationTokenSource expectedCts = new(); 80using CancellationTokenSource expectedCts = new(); 122using CancellationTokenSource expectedCts = new(); 173using CancellationTokenSource expectedCts = new();
ChatReduction\SummarizingChatReducerTests.cs (1)
281using var cts = new CancellationTokenSource();
ChatRouting\FailoverChatClientTests.cs (7)
73using var cancellationSource = new CancellationTokenSource(); 513using var cancellationSource = new CancellationTokenSource(); 538using var cancellationSource = new CancellationTokenSource(); 566using var cancellationSource = new CancellationTokenSource(); 661using var cancellationSource = new CancellationTokenSource(); 707using var cancellationSource = new CancellationTokenSource(); 929using var cancellationSource = new CancellationTokenSource();
ChatRouting\OrderedFailoverChatClientTests.cs (1)
296using var cancellationSource = new CancellationTokenSource();
Embeddings\ConfigureOptionsEmbeddingGeneratorTests.cs (1)
36using CancellationTokenSource cts = new();
Embeddings\UseDelegateEmbeddingGeneratorTests.cs (1)
30using CancellationTokenSource expectedCts = new();
Functions\AIFunctionFactoryTest.cs (9)
196using var cts = new CancellationTokenSource(); 975using CancellationTokenSource cts = new(); 998using CancellationTokenSource cts = new(); 1021using CancellationTokenSource cts = new(); 1044using CancellationTokenSource cts = new(); 1067using CancellationTokenSource cts = new(); 1090using CancellationTokenSource cts = new(); 1113using CancellationTokenSource cts = new(); 1136using CancellationTokenSource cts = new();
Image\ConfigureOptionsImageGeneratorTests.cs (1)
36using CancellationTokenSource cts = new();
Realtime\LoggingRealtimeClientTests.cs (3)
211using var cts = new CancellationTokenSource(); 272using var cts = new CancellationTokenSource(); 375using var cts = new CancellationTokenSource();
SpeechToText\ConfigureOptionsSpeechToTextClientTests.cs (1)
40using CancellationTokenSource cts = new();
TextToSpeech\ConfigureOptionsTextToSpeechClientTests.cs (1)
39using CancellationTokenSource cts = new();
Microsoft.Extensions.AsyncState (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.StampedeState.cs (1)
49_sharedCancellation = new();
Microsoft.Extensions.Caching.Hybrid.Tests (6)
StampedeTests.cs (6)
91using var cts = canBeCanceled ? new CancellationTokenSource() : null; 187cancels[i] = new CancellationTokenSource(); 268cancels[i] = new CancellationTokenSource(); 339using CancellationTokenSource? cts = withCancelation ? new() : null; 379using var cts = withCancelation ? new CancellationTokenSource() : null; 423using CancellationTokenSource? cts = withCancelation ? new() : null;
Microsoft.Extensions.Compliance.Abstractions (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.Configuration (1)
ConfigurationReloadToken.cs (1)
16private readonly CancellationTokenSource _cts = new CancellationTokenSource();
Microsoft.Extensions.DataIngestion.Tests (2)
Readers\DocumentReaderConformanceTests.cs (2)
38using CancellationTokenSource cts = new(); 56using CancellationTokenSource cts = new();
Microsoft.Extensions.Diagnostics.HealthChecks (1)
HealthCheckPublisherHostedService.cs (1)
50_stopping = new CancellationTokenSource();
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
MockHostApplicationLifetime.cs (3)
12private readonly CancellationTokenSource _started = new(); 13private readonly CancellationTokenSource _stopping = new(); 14private readonly CancellationTokenSource _stopped = new();
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
TcpEndpointProbesServiceTests.cs (2)
23using var cts = new CancellationTokenSource(); 89using var cts = new CancellationTokenSource();
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogCollector.LogEnumeration.cs (1)
93: new CancellationTokenSource();
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Logging\FakeLogCollectorTests.LogEnumeration.cs (1)
32using var cts = new CancellationTokenSource();
Metrics\MetricCollectorTests.cs (1)
283using var cts = new CancellationTokenSource();
Microsoft.Extensions.FileProviders.Physical (5)
PhysicalFilesWatcher.cs (5)
211var cancellationTokenSource = new CancellationTokenSource(); 236pollingChangeToken.CancellationTokenSource = new CancellationTokenSource(); 255var cancellationTokenSource = new CancellationTokenSource(); 279pollingChangeToken.CancellationTokenSource = new CancellationTokenSource(); 906private readonly CancellationTokenSource _cts = new();
Microsoft.Extensions.Hosting (3)
Internal\ApplicationLifetime.cs (3)
21private readonly CancellationTokenSource _startedSource = new CancellationTokenSource(); 22private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource(); 23private readonly CancellationTokenSource _stoppedSource = new CancellationTokenSource();
Microsoft.Extensions.Hosting.Testing.Tests (3)
FakeHostTests.cs (2)
81using var tokenSource = new CancellationTokenSource(); 140using var tokenSource = new CancellationTokenSource();
HostingFakesExtensionsTests.cs (1)
28using var tokenSource = new CancellationTokenSource();
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpClientLoggerTest.cs (1)
117using var cancellationTokenSource = new CancellationTokenSource();
Logging\HttpResponseBodyReaderTest.cs (1)
186using var cts = new CancellationTokenSource();
Microsoft.Extensions.Http.Resilience (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.Http.Resilience.PerformanceTests (2)
RetryBenchmark.cs (1)
30_cancellationToken = new CancellationTokenSource().Token;
StandardResilienceBenchmark.cs (1)
30_cancellationToken = new CancellationTokenSource().Token;
Microsoft.Extensions.Http.Resilience.Tests (2)
Hedging\HedgingTests.cs (1)
43_cancellationTokenSource = new CancellationTokenSource();
Resilience\ResilienceHandlerTest.cs (1)
128using var source = new CancellationTokenSource();
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLoggerProvider.cs (1)
161_cancellationTokenSource = new CancellationTokenSource();
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
401CancellationTokenSource cts = LazyInitializer.EnsureInitialized(ref _cancellationTokenSource, () => new CancellationTokenSource());
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (1)
41_stopping = new CancellationTokenSource();
ModelReloadToken.cs (1)
20_cts = new CancellationTokenSource();
Microsoft.Extensions.Primitives (1)
CompositeChangeToken.cs (1)
112_cancellationTokenSource = new CancellationTokenSource();
Microsoft.Extensions.ServiceDiscovery (1)
ServiceEndpointWatcher.cs (1)
30private readonly CancellationTokenSource _disposalCancellation = new();
Microsoft.Extensions.ServiceDiscovery.Dns (3)
DnsServiceEndpointProviderBase.cs (2)
16private readonly CancellationTokenSource _disposeCancellation = new(); 42var cancellation = _lastCollectionCancellation = new CancellationTokenSource();
Resolver\DnsResolver.cs (1)
25private readonly CancellationTokenSource _pendingRequestsCts = new();
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (2)
Resolver\CancellationTests.cs (2)
18CancellationTokenSource cts = new CancellationTokenSource(); 29CancellationTokenSource cts = new CancellationTokenSource();
Microsoft.Extensions.ServiceDiscovery.Tests (8)
ServiceEndpointResolverTests.cs (8)
88var cts = new[] { new CancellationTokenSource() }; 97cts[0] = new(); 140var cts = new[] { new CancellationTokenSource() }; 149cts[0] = new(); 176var cts = new[] { new CancellationTokenSource() }; 185cts[0] = new(); 214var cts = new[] { new CancellationTokenSource() }; 223cts[0] = new();
Microsoft.Extensions.Telemetry (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.Telemetry.Abstractions (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Microsoft.Extensions.TimeProvider.Testing.Tests (2)
FakeTimeProviderTests.cs (2)
317using var cs = new CancellationTokenSource(); 431using var cts = new CancellationTokenSource();
Microsoft.Maui (1)
ImageSources\ImageSourceServiceResultManager.cs (1)
41 _sourceCancellation = new CancellationTokenSource();
Microsoft.Maui.Controls (1)
ImageSource.cs (1)
149 CancellationTokenSource = new CancellationTokenSource();
Microsoft.Maui.Resizetizer (1)
AsyncTask.cs (1)
18 readonly CancellationTokenSource cts = new CancellationTokenSource();
Microsoft.ML.AutoML (2)
AutoMLExperiment\AutoMLExperiment.cs (1)
252var trialCancellationTokenSource = new CancellationTokenSource();
AutoMLExperiment\IStopTrainingManager.cs (1)
66_cts = new CancellationTokenSource();
Microsoft.ML.AutoML.Tests (5)
AutoMLExperimentTests.cs (3)
47var cts = new CancellationTokenSource(); 134var cts = new CancellationTokenSource(); 173var cts = new CancellationTokenSource();
StopTrainingManagerTests.cs (2)
28var cts = new CancellationTokenSource(); 72var cts = new CancellationTokenSource();
Microsoft.ML.Core (2)
Utilities\ResourceManagerUtils.cs (1)
158using (var downloadCancel = new CancellationTokenSource())
Utilities\ThreadUtils.cs (1)
196_ctSource = new CancellationTokenSource();
Microsoft.ML.Maml (1)
MAML.cs (1)
63using (var progressCancel = new CancellationTokenSource())
Microsoft.ML.Sweeper (1)
AsyncSweeper.cs (1)
206_cts = new CancellationTokenSource();
Microsoft.NET.Build.Containers (2)
Tasks\CreateImageIndex.cs (1)
17private readonly CancellationTokenSource _cancellationTokenSource = new();
Tasks\CreateNewImage.cs (1)
15private readonly CancellationTokenSource _cancellationTokenSource = new();
Microsoft.NET.Build.Tasks (1)
GenerateBundle.cs (1)
15private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
Microsoft.NET.Sdk.Razor.Tasks (1)
DotnetToolTask.cs (1)
148using (_razorServerCts = new CancellationTokenSource())
Microsoft.TemplateEngine.Cli (3)
Commands\create\InstantiateCommand.TabCompletion.cs (2)
143CancellationTokenSource cancellationTokenSource = new(); 173CancellationTokenSource cancellationTokenSource = new();
Commands\create\TemplateCommand.cs (1)
171CancellationTokenSource cancellationTokenSource = new();
Microsoft.TemplateEngine.Edge (2)
BuiltInManagedProvider\GlobalSettings.cs (1)
205CancellationTokenSource cts = new();
TemplateConstraintManager.cs (1)
16private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
Microsoft.TestPlatform.CommunicationUtilities (3)
DataCollectionRequestHandler.cs (1)
100_cancellationTokenSource = new CancellationTokenSource();
SocketClient.cs (1)
39_cancellation = new CancellationTokenSource();
SocketServer.cs (1)
58_cancellation = new CancellationTokenSource();
Microsoft.TestPlatform.CrossPlatEngine (2)
Client\ProxyOperationManager.cs (1)
102CancellationTokenSource = new CancellationTokenSource();
Discovery\DiscoveryManager.cs (1)
38private readonly CancellationTokenSource _cancellationTokenSource = new();
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
NetClientHangDumper.cs (1)
59var timeout = new CancellationTokenSource();
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (2)
VsTestConsoleRequestSender.cs (2)
86_processExitCancellationTokenSource = new CancellationTokenSource(); 127_processExitCancellationTokenSource = new CancellationTokenSource();
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\ApplicationServices\WindowsFormsApplicationBase.vb (2)
1097Dim tokenSource As New CancellationTokenSource() 1110Dim tokenSource As New CancellationTokenSource()
Microsoft.VisualStudio.TestPlatform.Common (1)
DataCollection\DataCollectionAttachmentManager.cs (1)
81_cancellationTokenSource = new CancellationTokenSource();
MSBuild (1)
XMake.cs (1)
144private static readonly CancellationTokenSource s_buildCancellationSource = new CancellationTokenSource();
MSBuild.Coordinator (2)
CoordinatorServer.cs (1)
30private readonly CancellationTokenSource _cts = new();
Program.cs (1)
30using CancellationTokenSource cts = new();
Nats.Backend (1)
Program.cs (1)
18private readonly CancellationTokenSource _cts = new();
NuGet.Build.Tasks (2)
RestoreTask.cs (1)
33private readonly CancellationTokenSource _cts = new CancellationTokenSource();
StaticGraphRestoreTaskBase.cs (1)
27internal readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
NuGet.Protocol (4)
Plugins\StandardInputReceiver.cs (1)
45_receiveCancellationTokenSource = new CancellationTokenSource();
Resources\PackageUpdateResource.cs (1)
98using var tokenSource = new CancellationTokenSource();
Utility\TimeoutUtility.cs (2)
35using (var timeoutTcs = new CancellationTokenSource()) 36using (var taskTcs = new CancellationTokenSource())
Roslyn.Diagnostics.Analyzers (5)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
122_entireQueueCancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
40_cts = new CancellationTokenSource();
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
415public readonly CancellationTokenSource Cancellation = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
380_asynchronousComputationCancellationSource = new CancellationTokenSource();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
89_entireQueueCancellationTokenSource = new CancellationTokenSource();
rzc (2)
DefaultRequestDispatcher.cs (1)
166_listenCancellationTokenSource = new CancellationTokenSource();
Program.cs (1)
27var cancel = new CancellationTokenSource();
Shared (1)
Pools\PooledCancellationTokenSourcePolicy.cs (1)
22public override CancellationTokenSource Create() => new();
Stress.AppHost (1)
TestResource.cs (1)
152private readonly CancellationTokenSource _tokenSource = new();
System.Collections.Concurrent (2)
System\Collections\Concurrent\BlockingCollection.cs (2)
217_consumersCancellationTokenSource = new CancellationTokenSource(); 218_producersCancellationTokenSource = new CancellationTokenSource();
System.Data.Odbc (1)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
48CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
System.Data.OleDb (1)
System\Data\ProviderBase\DbConnectionFactory.cs (1)
157CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\AggregationManager.cs (1)
29private readonly CancellationTokenSource _cts = new();
System.Diagnostics.Process (1)
System\Diagnostics\AsyncStreamReader.cs (1)
63_cts = new CancellationTokenSource();
System.IO.Pipelines (2)
System\IO\Pipelines\StreamPipeReader.cs (1)
79return _internalTokenSource ??= new CancellationTokenSource();
System\IO\Pipelines\StreamPipeWriter.cs (1)
41return _internalTokenSource ??= new CancellationTokenSource();
System.IO.Pipes (1)
System\IO\Pipes\NamedPipeServerStream.Unix.cs (1)
22private readonly CancellationTokenSource _internalTokenSource = new CancellationTokenSource();
System.Linq.Parallel (4)
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
45private readonly CancellationTokenSource _topLevelCancellationTokenSource = new CancellationTokenSource();
System\Linq\Parallel\QueryOperators\QuerySettings.cs (1)
137return WithPerExecutionSettings(new CancellationTokenSource(), new Shared<bool>(false));
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (1)
53CancellationTokenSource dummyInternalCancellationTokenSource = new CancellationTokenSource();
System\Linq\ParallelEnumerable.cs (1)
4386.WithPerExecutionSettings(new CancellationTokenSource(), new System.Linq.Parallel.Shared<bool>(false));
System.Net.Http (7)
System\Net\Http\HttpClient.cs (2)
155_pendingRequestsCts = new CancellationTokenSource(); 702CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingRequestsCts, new CancellationTokenSource());
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
829_altSvcBlocklistTimerCancellation = new CancellationTokenSource();
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (2)
115_requestBodyCancellationSource = new CancellationTokenSource(); 127_requestBodyCancellationSource = new CancellationTokenSource();
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
81_requestBodyCancellationSource = new CancellationTokenSource();
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
102_connectionDisposalCts = new CancellationTokenSource();
System.Net.Mail (2)
System\Net\Mail\SmtpClient.cs (2)
93_pendingSendCts = new CancellationTokenSource(); 631CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingSendCts, new CancellationTokenSource());
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.cs (1)
87_timeoutOrCancellationSource ??= new();
System.Net.Quic (2)
System\Net\Quic\QuicConnection.cs (1)
145private readonly CancellationTokenSource _shutdownTokenSource = new CancellationTokenSource();
System\Net\Quic\QuicListener.cs (1)
91private readonly CancellationTokenSource _disposeCts = new CancellationTokenSource();
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1202_sendRequestCts = new CancellationTokenSource();
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
608_multipleConnectCancellation = saeaMultiConnectCancelable ? new CancellationTokenSource() : null;
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (1)
16m_dispatchTaskCancellationSource = new CancellationTokenSource();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (3)
29internal static readonly CancellationTokenSource s_canceledSource = new CancellationTokenSource() { _state = States.NotifyingCompleteState }; 31internal static readonly CancellationTokenSource s_neverCanceledSource = new CancellationTokenSource(); 854token.CanBeCanceled ? new Linked1CancellationTokenSource(token) : new CancellationTokenSource();
System.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
990_httpSendCts = new CancellationTokenSource();
System.ServiceModel.Primitives (1)
Internals\System\Runtime\TaskHelpers.cs (1)
232using (CancellationTokenSource cts = new CancellationTokenSource())
System.Threading.Tasks.Dataflow (2)
Base\DataflowBlock.cs (2)
1125internal readonly CancellationTokenSource _cts = new CancellationTokenSource(); 2358internal readonly CancellationTokenSource Canceler = new CancellationTokenSource();
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\Parallel.ForEachAsync.cs (1)
537public readonly CancellationTokenSource Cancellation = new CancellationTokenSource();
System.Windows.Extensions (1)
System\Media\SoundPlayer.cs (1)
326var cts = new CancellationTokenSource();
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Animation\HighPrecisionTimer.cs (1)
697CancellationSource = new CancellationTokenSource();
VBCSCompiler (3)
src\roslyn\src\Compilers\Server\VBCSCompiler\BuildServerController.cs (1)
36var cancellationTokenSource = new CancellationTokenSource();
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnection.cs (1)
20private CancellationTokenSource DisconnectCancellationTokenSource { get; } = new CancellationTokenSource();
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
59_cancellationTokenSource = new CancellationTokenSource();
vstest.console (1)
TestPlatformHelpers\TestRequestManager.cs (1)
456_currentAttachmentsProcessingCancellationTokenSource = new CancellationTokenSource();
vstest.console.arm64 (1)
src\vstest\src\vstest.console\TestPlatformHelpers\TestRequestManager.cs (1)
456_currentAttachmentsProcessingCancellationTokenSource = new CancellationTokenSource();