199 references to IsCancellationRequested
ApiExplorerWebSite (2)
ActionDescriptorChangeProvider.cs (1)
20if (ChangeToken.TokenSource.IsCancellationRequested)
ApiExplorerRouteChangeConvention.cs (1)
19if (action.Attributes.OfType<ReloadAttribute>().Any() && ChangeToken.TokenSource.IsCancellationRequested)
Aspire.Dashboard (5)
Components\Interactions\InteractionsProvider.cs (3)
73catch (Exception ex) when (!_cts.IsCancellationRequested) 85catch (Exception ex) when (!_cts.IsCancellationRequested) 96while (!_cts.IsCancellationRequested)
Model\MetricsHelpers.cs (1)
51while (!cts.IsCancellationRequested)
Model\ResourceOutgoingPeerResolver.cs (1)
191if (_subscriptions.Count == 0 || _watchContainersTokenSource.IsCancellationRequested)
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
93catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Aspire.Hosting (4)
ApplicationModel\ResourceLoggerService.cs (1)
577if (loggerState._logStreamCts.IsCancellationRequested)
Dcp\DcpHost.cs (2)
103catch (OperationCanceledException) when (timeoutCancellation.IsCancellationRequested) 244while (!_shutdownCts.IsCancellationRequested)
Publishing\PublishingActivityProgressReporter.cs (1)
693if (!_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)
553Assert.False(cts.IsCancellationRequested);
Aspire.Hosting.Tests (2)
Dcp\DcpExecutorTests.cs (1)
1231Assert.True(tokenSource.IsCancellationRequested);
DistributedApplicationTests.cs (1)
487while (!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)
ClientSample (1)
HubSample.cs (1)
104catch when (closedTokenSource.IsCancellationRequested)
GenerateDocumentationAndConfigFiles (1)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Metrics (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Metrics.Legacy (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
325if (!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.OutputCaching.Tests (4)
MemoryOutputCacheStoreTests.cs (4)
80while (store.TaggedEntries.TryGetValue("tag1", out tag1s) && !cts.IsCancellationRequested) 186while (store.TaggedEntries.TryGetValue("tag1", out tag1s) && !cts.IsCancellationRequested) 191while (store.TaggedEntries.TryGetValue("tag2", out tag2s) && tag2s.Count != 1 && !cts.IsCancellationRequested) 226while (store.TaggedEntries.TryGetValue("tag2", out tag2s) && !cts.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.Client.FunctionalTests (1)
HubConnectionTests.cs (1)
909Assert.True(cts.IsCancellationRequested);
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (1)
482if (_connectionAbortedTokenSource.IsCancellationRequested)
Internal\DefaultHubDispatcher.cs (1)
580if (!(ex is OperationCanceledException && streamCts.IsCancellationRequested))
Microsoft.Build (1)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
274if (_cancellationTokenSource.IsCancellationRequested)
Microsoft.Build.Tasks.Core (9)
Copy.cs (5)
473return success && !_cancellationTokenSource.IsCancellationRequested; 497for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 590for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 641for (int partitionIndex = 0; partitionIndex < partition.Count && !_cancellationTokenSource.IsCancellationRequested; partitionIndex++) 953while (!_cancellationTokenSource.IsCancellationRequested)
DownloadFile.cs (1)
138return !_cancellationTokenSource.IsCancellationRequested && !Log.HasLoggedErrors;
Unzip.cs (3)
107foreach (ITaskItem sourceFile in SourceFiles.TakeWhile(i => !_cancellationToken.IsCancellationRequested)) 153return !_cancellationToken.IsCancellationRequested && !Log.HasLoggedErrors; 165foreach (ZipArchiveEntry zipArchiveEntry in sourceArchive.Entries.TakeWhile(i => !_cancellationToken.IsCancellationRequested))
Microsoft.CodeAnalysis.Analyzers (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.BannedApiAnalyzers (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.CodeStyle (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.ExternalAccess.Copilot (1)
Internal\SemanticSearch\CopilotSemanticSearchQueryExecutor.cs (1)
125catch (OperationCanceledException) when (cancellationSource.IsCancellationRequested)
Microsoft.CodeAnalysis.Features (1)
SemanticSearch\QueryExecutionContext.cs (1)
116catch (OperationCanceledException) when (symbolEnumerationCancellationSource.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
197while (!_cancelSource.IsCancellationRequested)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.PublicApiAnalyzers (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteWorkspace.InFlightSolution.cs (1)
110Contract.ThrowIfTrue(this._cancellationTokenSource_doNotAccessDirectly.IsCancellationRequested);
Microsoft.CodeAnalysis.ResxSourceGenerator (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
2685if (!_cancellationTokenSource.IsCancellationRequested) 2954if (!_cancellationTokenSource.IsCancellationRequested)
Microsoft.CodeAnalysis.Threading.Package (1)
CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Microsoft.CodeAnalysis.Workspaces (5)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (2)
170if (!Storage._shutdownTokenSource.IsCancellationRequested) 229if (!Storage._shutdownTokenSource.IsCancellationRequested)
Storage\SQLite\v2\SQLitePersistentStorage_FlushWrites.cs (1)
39if (_shutdownTokenSource.IsCancellationRequested)
Storage\SQLite\v2\SQLitePersistentStorage+PooledConnection.cs (1)
71if (_shutdownTokenSource.IsCancellationRequested)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
MEF\UseExportProviderAttribute.cs (1)
147catch (OperationCanceledException ex) when (timeoutTokenSource.IsCancellationRequested)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
RequestExecutionQueue.cs (1)
197while (!_cancelSource.IsCancellationRequested)
Microsoft.DotNet.Build.Tasks.Installers (1)
src\ExecWithRetries.cs (1)
92if (i + 1 == MaxAttempts || _cancelTokenSource.IsCancellationRequested)
Microsoft.Extensions.Configuration (1)
ConfigurationReloadToken.cs (1)
28public bool HasChanged => _cts.IsCancellationRequested;
Microsoft.Extensions.Configuration.KeyPerFile.Tests (2)
KeyPerFileTests.cs (2)
224while (!cts.IsCancellationRequested) 232while (!cts.IsCancellationRequested)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
HealthCheckPublisherHostedService.cs (1)
58internal bool IsStopping => _stopping.IsCancellationRequested;
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalFilesWatcher.cs (1)
455if (matchInfo.TokenSource.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.ObjectPool.Tests (1)
ThreadingTest.cs (1)
58while (!_cts.IsCancellationRequested)
Microsoft.Extensions.Primitives (2)
CompositeChangeToken.cs (2)
110if (_cancellationTokenSource.IsCancellationRequested) 134if (compositeChangeTokenState._cancellationTokenSource.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery (3)
ServiceEndpointWatcher.cs (3)
64ObjectDisposedException.ThrowIf(_disposalCancellation.IsCancellationRequested, this); 99if (!_disposalCancellation.IsCancellationRequested && _refreshTask.IsCompleted && (_cacheState == CacheStatus.Invalid || _cachedEndpoints is null or { ChangeToken.HasChanged: true } || force)) 235if (_disposalCancellation.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.cs (1)
476!pendingRequestsCts.IsCancellationRequested) // not cancelled by the global token (dispose)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
218if (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)
MSBuild (3)
XMake.cs (3)
1171if (s_buildCancellationSource.IsCancellationRequested) 1835if (s_buildCancellationSource.IsCancellationRequested) 1854if (s_buildCancellationSource.IsCancellationRequested)
Roslyn.Diagnostics.Analyzers (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
System.Collections.Concurrent (3)
System\Collections\Concurrent\BlockingCollection.cs (3)
991if (linkedTokenSource.IsCancellationRequested) 1389if (linkedTokenSource.IsCancellationRequested) 1394if (!linkedTokenSource.IsCancellationRequested) // if neither internal nor external cancellation requested
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)
294else if (tokenSource.IsCancellationRequested) 317if (tokenSource.IsCancellationRequested) 388if (tokenSource.IsCancellationRequested) 467bool isCancellationRequested = source.IsCancellationRequested;
System.Net.Http (4)
System\Net\Http\HttpClient.cs (3)
596else if (cts.IsCancellationRequested && !pendingRequestsCts.IsCancellationRequested) 610else if (e is HttpRequestException && cts.IsCancellationRequested) // if cancellationToken is canceled, cts will also be canceled
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
339Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested);
System.Net.Quic (3)
System\Net\Quic\QuicListener.cs (1)
252catch (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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
136if (m_dispatchTaskCancellationSource?.IsCancellationRequested ?? true)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationToken.cs (1)
65public bool IsCancellationRequested => _source != null && _source.IsCancellationRequested;
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\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (7)
113if (IsCancellationRequested) 327Debug.Assert(IsCancellationRequested); 426if (IsCancellationRequested) 593if (!IsCancellationRequested) 684if (!IsCancellationRequested || !registrations.Unregister(id, node)) 710if (!IsCancellationRequested && 737Debug.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);
Test.Utilities (1)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
Text.Analyzers (6)
src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (5)
135while (!state.Cancellation.IsCancellationRequested) 142if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 300while (!state.Cancellation.IsCancellationRequested) 307if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 544Debug.Assert(!Cancellation.IsCancellationRequested);
VBCSCompiler.UnitTests (1)
ServerUtil.cs (1)
147if (!CancellationTokenSource.IsCancellationRequested)