171 references to IsCancellationRequested
aspire (1)
Program.cs (1)
746if (!(ex is OperationCanceledException && cts.IsCancellationRequested) && ex is not ExtensionOperationCanceledException)
Aspire.Dashboard (7)
Components\Controls\AssistantChat.razor.cs (1)
128if (_cts.IsCancellationRequested)
Components\Interactions\InteractionsProvider.cs (3)
114catch (Exception ex) when (!_cts.IsCancellationRequested) 126catch (Exception ex) when (!_cts.IsCancellationRequested) 137while (!_cts.IsCancellationRequested)
Model\Assistant\AssistantChatViewModel.cs (1)
597if (_currentResponseCts?.IsCancellationRequested ?? false)
Model\ResourceOutgoingPeerResolver.cs (1)
270if (_subscriptions.Count == 0 || _watchContainersTokenSource.IsCancellationRequested)
Model\TraceLinkHelpers.cs (1)
68while (!cts.IsCancellationRequested)
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
93catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Aspire.Hosting (7)
ApplicationModel\ResourceLoggerService.cs (1)
594if (loggerState._logStreamCts.IsCancellationRequested)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
263catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested)
Dcp\DcpHost.cs (2)
117catch (OperationCanceledException) when (timeoutCancellation.IsCancellationRequested) 332while (!_shutdownCts.IsCancellationRequested)
Devcontainers\DevcontainerSettingsWriter.cs (2)
85catch (OperationCanceledException) when (_processingCancellation.IsCancellationRequested) 96catch (OperationCanceledException) when (_processingCancellation.IsCancellationRequested)
Pipelines\PipelineActivityReporter.cs (1)
469if (!_cancellationTokenSource.IsCancellationRequested)
Aspire.Hosting.Testing (8)
DistributedApplicationFactory.cs (8)
48ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 71ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 85ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 99ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 115ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 502if (_disposingCts.IsCancellationRequested) 538catch (OperationCanceledException) when (_disposingCts.IsCancellationRequested) 547catch (OperationCanceledException) when (_disposingCts.IsCancellationRequested)
Aspire.Hosting.Testing.Tests (1)
TestingBuilderTests.cs (1)
566Assert.False(cts.IsCancellationRequested);
Aspire.Hosting.Tests (2)
Dcp\DcpExecutorTests.cs (1)
1349Assert.True(tokenSource.IsCancellationRequested);
DistributedApplicationTests.cs (1)
647while (!cts.IsCancellationRequested)
Aspire.Templates.Tests (2)
TemplateTestsBase.cs (1)
189while (foundNames.Count < expectedRowsTable.Count && !cts.IsCancellationRequested)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
93catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Infrastructure.Tests (2)
PowerShellScripts\PowerShellCommand.cs (1)
67catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
WorkflowScripts\NodeCommand.cs (1)
61catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Microsoft.AspNetCore.Components.Forms (2)
EditContext.cs (2)
477var faulted = task.IsFaulted || (task.IsCanceled && !cts.IsCancellationRequested); 622catch (OperationCanceledException) when (cts.IsCancellationRequested)
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
450if (!thisLoadCts.IsCancellationRequested)
Microsoft.AspNetCore.Hosting (1)
Internal\WebHostLifetime.cs (1)
58if (!_cts.IsCancellationRequested)
Microsoft.AspNetCore.Http (1)
Timeouts\RequestTimeoutsMiddleware.cs (1)
110when (linkedCts.IsCancellationRequested && !originalToken.IsCancellationRequested)
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionContext.cs (1)
648if (_sendCts == null || _sendCts.IsCancellationRequested)
Microsoft.AspNetCore.HttpLogging (1)
FileLoggerProcessor.cs (1)
121while (!_cancellationTokenSource.IsCancellationRequested)
Microsoft.AspNetCore.Session (3)
DistributedSession.cs (3)
232catch (OperationCanceledException oex) when (!cancellationToken.IsCancellationRequested && cts.IsCancellationRequested) 287catch (OperationCanceledException oex) when (!cancellationToken.IsCancellationRequested && cts.IsCancellationRequested) 299catch (OperationCanceledException oex) when (!cancellationToken.IsCancellationRequested && cts.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (2)
1578if (handshakeCts.IsCancellationRequested) 1891if (_state.StopCts.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (1)
519if (_connectionAbortedTokenSource.IsCancellationRequested)
Internal\DefaultHubDispatcher.cs (1)
580if (!(ex is OperationCanceledException && streamCts.IsCancellationRequested))
Microsoft.Build (2)
BackEnd\BuildManager\BuildManager.cs (1)
1302telemetry.IsCancellationRequested = _executionCancellationTokenSource?.IsCancellationRequested ?? false;
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
276if (_cancellationTokenSource.IsCancellationRequested)
Microsoft.Build.Tasks.Core (9)
Copy.cs (5)
489return success && !_cancellationTokenSource.IsCancellationRequested; 513for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 623for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 677for (int partitionIndex = 0; partitionIndex < partition.Count && !_cancellationTokenSource.IsCancellationRequested; partitionIndex++) 1009while (!_cancellationTokenSource.IsCancellationRequested)
DownloadFile.cs (1)
142return !_cancellationTokenSource.IsCancellationRequested && !Log.HasLoggedErrors;
Unzip.cs (3)
112foreach (ITaskItem sourceFile in SourceFiles.TakeWhile(i => !_cancellationToken.IsCancellationRequested)) 169return !_cancellationToken.IsCancellationRequested && !Log.HasLoggedErrors; 181foreach (ZipArchiveEntry zipArchiveEntry in sourceArchive.Entries.TakeWhile(i => !_cancellationToken.IsCancellationRequested))
Microsoft.CodeAnalysis.Analyzers (6)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.CodeStyle (6)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.ResxSourceGenerator (6)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Microsoft.Diagnostics.NETCore.Client (7)
DiagnosticsIpc\IpcServerTransport.cs (2)
147if (!linkedSource.IsCancellationRequested) 216if (!linkedSource.IsCancellationRequested)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (5)
239if (acceptTimeoutTokenSource.IsCancellationRequested) 265if (connectTimeoutTokenSource.IsCancellationRequested) 478if (connectTimeoutTokenSource.IsCancellationRequested) 594if (connectTimeoutTokenSource.IsCancellationRequested) 691if (connectTimeoutTokenSource.IsCancellationRequested)
Microsoft.DotNet.Build.Tasks.Installers (1)
src\ExecWithRetries.cs (1)
92if (i + 1 == MaxAttempts || _cancelTokenSource.IsCancellationRequested)
Microsoft.DotNet.HotReload.Watch (5)
HotReload\CompilationHandler.cs (1)
274catch (OperationCanceledException) when (processExitedSource.IsCancellationRequested)
HotReload\HotReloadDotNetWatcher.cs (2)
75_context.Logger.Log(source.IsCancellationRequested ? MessageDescriptor.RestartInProgress : MessageDescriptor.RestartRequested); 495else if (forceRestartCancellationSource.IsCancellationRequested)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
250if (_shutdownCancellationSource.IsCancellationRequested)
UI\ShutdownHandler.cs (1)
24var forceShutdown = _cancellationSource.IsCancellationRequested;
Microsoft.Extensions.Configuration (1)
ConfigurationReloadToken.cs (1)
28public bool HasChanged => _cts.IsCancellationRequested;
Microsoft.Extensions.Diagnostics.HealthChecks (1)
HealthCheckPublisherHostedService.cs (1)
58internal bool IsStopping => _stopping.IsCancellationRequested;
Microsoft.Extensions.FileProviders.Physical (4)
PhysicalFilesWatcher.cs (4)
742if (matchInfo.TokenSource.IsCancellationRequested) 959if (_cts.IsCancellationRequested) 968if (sender != _watcher || _cts.IsCancellationRequested) 1016if (sender != _watcher || _cts.IsCancellationRequested)
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpResponseBodyReader.cs (1)
85catch (OperationCanceledException) when (joinedTokenSource.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLoggerProvider.cs (1)
90while (!_cancellationTokenSource.IsCancellationRequested)
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (1)
68internal bool IsStopping => _stopping.IsCancellationRequested;
ModelReloadToken.cs (1)
31public bool HasChanged => _cts.IsCancellationRequested;
Microsoft.Extensions.Primitives (2)
CompositeChangeToken.cs (2)
122if (_cancellationTokenSource.IsCancellationRequested) 146if (compositeChangeTokenState._cancellationTokenSource.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery (4)
ServiceEndpointWatcher.cs (4)
64ObjectDisposedException.ThrowIf(_disposalCancellation.IsCancellationRequested, this); 99if (!_disposalCancellation.IsCancellationRequested && _refreshTask.IsCompleted && (_cacheState == CacheStatus.Invalid || _cachedEndpoints is null or { ChangeToken.HasChanged: true } || force)) 165if (_disposalCancellation.IsCancellationRequested) 251if (_disposalCancellation.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.cs (1)
474!pendingRequestsCts.IsCancellationRequested) // not cancelled by the global token (dispose)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
220if (cts[0].IsCancellationRequested)
Microsoft.ML.AutoML (2)
AutoMLExperiment\IPerformanceMonitor.cs (2)
149_logger.Trace($"maximum memory usage: {_settings.MaximumMemoryUsageInMegaByte}, PeakMemoryUsage: {metrics.PeakMemoryUsage} trialIsCancelled: {trialCancellationTokenSource.IsCancellationRequested}"); 150if (_settings.MaximumMemoryUsageInMegaByte is double d && metrics.PeakMemoryUsage > d && !trialCancellationTokenSource.IsCancellationRequested)
Microsoft.ML.AutoML.Tests (2)
AutoMLExperimentTests.cs (2)
147cts.IsCancellationRequested.Should().BeTrue(); 178cts.IsCancellationRequested.Should().BeFalse();
Microsoft.ML.Sweeper (2)
AsyncSweeper.cs (2)
242if (_cts.IsCancellationRequested) 278if (_cts.IsCancellationRequested)
Microsoft.NET.Build.Tasks (1)
GenerateBundle.cs (1)
155if (_cancellationTokenSource.IsCancellationRequested)
Microsoft.NET.Sdk.Publish.Tasks (1)
Tasks\ZipDeploy\ZipDeploymentStatus.cs (1)
44while (!tokenSource.IsCancellationRequested
Microsoft.TestPlatform.CrossPlatEngine (3)
Client\ProxyDiscoveryManager.cs (1)
201if (!(_proxyOperationManager != null && _proxyOperationManager.CancellationTokenSource.IsCancellationRequested && exception is CommunicationException))
Discovery\DiscoveryManager.cs (2)
155var isAborted = _cancellationTokenSource.IsCancellationRequested; 209if (!_cancellationTokenSource.IsCancellationRequested)
MSBuild (3)
XMake.cs (3)
1193if (s_buildCancellationSource.IsCancellationRequested) 1855if (s_buildCancellationSource.IsCancellationRequested) 1874if (s_buildCancellationSource.IsCancellationRequested)
NuGet.Build.Tasks (1)
StaticGraphRestoreTaskBase.cs (1)
211if (_cancellationTokenSource.IsCancellationRequested)
Roslyn.Diagnostics.Analyzers (6)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
System.Collections.Concurrent (3)
System\Collections\Concurrent\BlockingCollection.cs (3)
991if (linkedTokenSource.IsCancellationRequested) 1390if (linkedTokenSource.IsCancellationRequested) 1395if (!linkedTokenSource.IsCancellationRequested) // if neither internal nor external cancellation requested
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\Validator.cs (2)
744catch (OperationCanceledException) when (linkedCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 886catch (OperationCanceledException) when (linkedCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\AggregationManager.cs (1)
176Debug.Assert(_collectThread == null && !_cts.IsCancellationRequested);
System.IO.Pipelines (4)
System\IO\Pipelines\StreamPipeReader.cs (4)
291else if (tokenSource.IsCancellationRequested) 314if (tokenSource.IsCancellationRequested) 385if (tokenSource.IsCancellationRequested) 464bool isCancellationRequested = source.IsCancellationRequested;
System.Net.Http (4)
System\Net\Http\HttpClient.cs (3)
617else if (cts.IsCancellationRequested && !pendingRequestsCts.IsCancellationRequested) 631else if (e is HttpRequestException && cts.IsCancellationRequested) // if cancellationToken is canceled, cts will also be canceled
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
355Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested);
System.Net.Quic (3)
System\Net\Quic\QuicListener.cs (1)
254catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested)
System\Net\Quic\QuicStream.Stream.cs (2)
130catch (OperationCanceledException) when (cts?.IsCancellationRequested == true) 189catch (OperationCanceledException) when (cts?.IsCancellationRequested == true)
System.Private.CoreLib (11)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
136if (m_dispatchTaskCancellationSource?.IsCancellationRequested ?? true)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationToken.cs (1)
65public bool IsCancellationRequested => _source != null && _source.IsCancellationRequested;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenRegistration.cs (2)
50if (source.IsCancellationRequested && // Running callbacks has commenced. 80if (source.IsCancellationRequested && // Running callbacks has commenced.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (7)
113if (IsCancellationRequested) 327Debug.Assert(IsCancellationRequested); 426if (IsCancellationRequested) 593if (!IsCancellationRequested) 678if (!IsCancellationRequested || !registrations.Unregister(id, node)) 704if (!IsCancellationRequested && 731Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true");
System.Threading.Tasks.Dataflow (2)
Base\DataflowBlock.cs (2)
1273(_externalCancellationToken.IsCancellationRequested || _cts.IsCancellationRequested)) 2008if (cts.IsCancellationRequested)
System.Threading.Tasks.Parallel (7)
System\Threading\Tasks\Parallel.ForEachAsync.cs (7)
105while (!state.Cancellation.IsCancellationRequested) 129if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 269while (!state.Cancellation.IsCancellationRequested) 276if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 424while (!state.Cancellation.IsCancellationRequested) 431if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 653Debug.Assert(!Cancellation.IsCancellationRequested);