1246 references to IsCancellationRequested
aspire (3)
Commands\RunCommand.cs (2)
276catch (ConnectionLostException) when (cancellationToken.IsCancellationRequested) 392catch (ConnectionLostException) when (cancellationToken.IsCancellationRequested)
DotNet\DotNetCliRunner.cs (1)
564while (!cancellationToken.IsCancellationRequested && !reader.EndOfStream)
Aspire.Cli.Tests (4)
Commands\PublishCommandPromptingIntegrationTests.cs (3)
739if (_shouldCancel || cancellationToken.IsCancellationRequested) 754if (_shouldCancel || cancellationToken.IsCancellationRequested) 776if (_shouldCancel || cancellationToken.IsCancellationRequested)
Commands\RunCommandTests.cs (1)
172while (!cancellationToken.IsCancellationRequested)
Aspire.Dashboard (8)
Components\Controls\Chart\ChartBase.cs (1)
78if (CancellationToken.IsCancellationRequested ||
Components\Pages\ConsoleLogs.razor.cs (2)
762if (!subscription.CancellationToken.IsCancellationRequested) 781if (!subscription.CancellationToken.IsCancellationRequested && !_isSubscribedToAll)
ServiceClient\DashboardClient.cs (2)
265catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) 326catch (ObjectDisposedException) when (cancellationToken.IsCancellationRequested)
src\Shared\ChannelExtensions.cs (3)
32while (!cancellationToken.IsCancellationRequested) 48while (!cancellationToken.IsCancellationRequested && channel.Reader.TryRead(out var log)) 54if (!cancellationToken.IsCancellationRequested && batch is not null)
Aspire.Hosting (25)
Backchannel\AppHostRpcTarget.cs (1)
55while (cancellationToken.IsCancellationRequested == false)
Dashboard\DashboardService.cs (2)
353catch (OperationCanceledException) when (cts.Token.IsCancellationRequested) 357catch (IOException) when (cts.Token.IsCancellationRequested)
Dcp\DcpDependencyCheck.cs (1)
112&& !(ex is OperationCanceledException && cancellationToken.IsCancellationRequested))
Dcp\DcpExecutor.cs (2)
158catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) 344catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
Dcp\DcpHost.cs (1)
351while (!cancellationToken.IsCancellationRequested)
Dcp\ResourceLogSource.cs (2)
74while (!cancellationToken.IsCancellationRequested) 91catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
Devcontainers\Codespaces\CodespacesResourceUrlRewriterService.cs (2)
67catch (Exception ex) when (!stoppingToken.IsCancellationRequested) 74} while (!stoppingToken.IsCancellationRequested);
Health\ResourceHealthCheckService.cs (4)
63if (state.CancellationToken.IsCancellationRequested) 130while (!cancellationToken.IsCancellationRequested) 150catch (Exception ex) when (!cancellationToken.IsCancellationRequested) 193catch (Exception ex) when (!cancellationToken.IsCancellationRequested)
ResourceLoggerForwarderService.cs (2)
55catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) 82catch (TaskCanceledException) when (cancellationToken.IsCancellationRequested)
src\Shared\ChannelExtensions.cs (3)
32while (!cancellationToken.IsCancellationRequested) 48while (!cancellationToken.IsCancellationRequested && channel.Reader.TryRead(out var log)) 54if (!cancellationToken.IsCancellationRequested && batch is not null)
Utils\PeriodicRestartAsyncEnumerable.cs (4)
23while (!cancellationToken.IsCancellationRequested) 45catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) 79while (!cancellationToken.IsCancellationRequested) 101catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
VersionChecking\VersionCheckService.cs (1)
73if (!stoppingToken.IsCancellationRequested)
Aspire.Hosting.OpenAI (1)
StatusPageHealthCheck.cs (1)
56catch (OperationCanceledException oce) when (!cancellationToken.IsCancellationRequested)
Aspire.Hosting.Testing (1)
DistributedApplicationHostingTestingExtensions.cs (1)
119if (!lifetime.ApplicationStarted.IsCancellationRequested)
Aspire.Hosting.Testing.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
116catch (TaskCanceledException te) when (cancellationToken.IsCancellationRequested)
Aspire.Hosting.Tests (8)
Codespaces\CodespacesUrlRewriterTests.cs (1)
38while (!abortToken.Token.IsCancellationRequested)
Dcp\DcpHostNotificationTests.cs (2)
294Assert.False(interaction.CancellationToken.IsCancellationRequested); // Should not be cancelled yet 367Assert.False(interaction.CancellationToken.IsCancellationRequested);
Health\ResourceHealthCheckServiceTests.cs (1)
195Assert.False(monitor2.CancellationToken.IsCancellationRequested);
Utils\Grpc\TestServerStreamWriter.cs (2)
46if (_serverCallContext.CancellationToken.IsCancellationRequested || 47_serverCallContext.CancellationToken.IsCancellationRequested)
Utils\LoggerNotificationExtensions.cs (1)
116catch (TaskCanceledException te) when (cancellationToken.IsCancellationRequested)
Utils\PeriodicRestartAsyncEnumerableTests.cs (1)
61while (!cancellationToken.IsCancellationRequested)
Aspire.Playground.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
116catch (TaskCanceledException te) when (cancellationToken.IsCancellationRequested)
BuildActionTelemetryTable (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
ClientSample (2)
HubSample.cs (2)
94if (line == null || closedTokenSource.Token.IsCancellationRequested) 136catch when (token.IsCancellationRequested)
CodeStyleConfigFileGenerator (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Consumer (1)
ConsumerWorker.cs (1)
16while (!stoppingToken.IsCancellationRequested)
csc (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
343while (!cancellationToken.IsCancellationRequested && pipeStream.IsConnected)
CustomResources.AppHost (1)
TalkingClockResource.cs (1)
92while (!token.IsCancellationRequested)
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
304if (cancellationToken.IsCancellationRequested)
dotnet-svcutil-lib (14)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedWriteStream.cs (2)
166if (cancellationToken.IsCancellationRequested) 402if (cancellationToken.IsCancellationRequested)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (2)
952if (cancelTokenTask.Result.IsCancellationRequested) 1017if (cancelToken.IsCancellationRequested)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (5)
149if (cancelToken.IsCancellationRequested) 1022if (cancelToken.IsCancellationRequested) 1069if (cancellationToken.IsCancellationRequested) 1149if (cancellationToken.IsCancellationRequested) 1223if (cancelTokenTask.Result.IsCancellationRequested)
Metadata\MetadaExchangeResolver.cs (2)
187if (cancellationToken.IsCancellationRequested) 257if (cancellationToken.IsCancellationRequested)
Shared\Utilities\AsyncHelper.cs (2)
30if (cancellationToken.IsCancellationRequested) 53if (cancellationToken.IsCancellationRequested)
Shared\Utilities\ProcessRunner.cs (1)
130if (!cancellationToken.IsCancellationRequested)
GenerateDocumentationAndConfigFiles (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
HelixTestRunner (2)
TestRunner.cs (2)
247if (cts.Token.IsCancellationRequested) 269if (cts.Token.IsCancellationRequested)
IIS.Tests (1)
ResponseAbortTests.cs (1)
132tokenAborted = ctx.RequestAborted.IsCancellationRequested;
InMemory.FunctionalTests (10)
ConnectionLimitTests.cs (1)
64while (!context.RequestAborted.IsCancellationRequested)
Http2\Http2ConnectionTests.cs (2)
4164Assert.False(lifetime.ConnectionClosedRequested.IsCancellationRequested); 4168Assert.True(lifetime.ConnectionClosedRequested.IsCancellationRequested);
Http3\Http3ConnectionTests.cs (2)
328Assert.False(lifetime.ConnectionClosedRequested.IsCancellationRequested); 333Assert.True(lifetime.ConnectionClosedRequested.IsCancellationRequested);
HttpsConnectionMiddlewareTests.cs (1)
646lifetimeNotificationFeature.ConnectionClosedRequested.IsCancellationRequested,
HttpsTests.cs (1)
235while (!ct.IsCancellationRequested)
KeepAliveTimeoutTests.cs (1)
307if (token.IsCancellationRequested)
UpgradeTests.cs (2)
136while (!context.RequestAborted.IsCancellationRequested) 316while (!context.RequestAborted.IsCancellationRequested)
InProcessWebSite (1)
Startup.WebSockets.cs (1)
171while (!result.CloseStatus.HasValue && !token.IsCancellationRequested && !closeFromServer)
Metrics (22)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
Metrics.Legacy (22)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore (2)
WebApplication.cs (2)
259private bool IsRunning => Lifetime.ApplicationStarted.IsCancellationRequested && !Lifetime.ApplicationStopped.IsCancellationRequested;
Microsoft.AspNetCore.Components.QuickGrid (2)
QuickGrid.razor.cs (2)
353if (request.CancellationToken.IsCancellationRequested) 371if (!request.CancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Components.Server (1)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (1)
66while (!cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Components.Server.Tests (8)
Circuits\CircuitClientProxyTest.cs (1)
20isCancelled = token.IsCancellationRequested;
Circuits\RemoteJSDataStreamTest.cs (5)
302Assert.False(linkedCts.Token.IsCancellationRequested); 306Assert.True(linkedCts.Token.IsCancellationRequested); 317Assert.False(linkedCts.Token.IsCancellationRequested); 331Assert.False(linkedCts.Token.IsCancellationRequested); 342Assert.True(linkedCts.Token.IsCancellationRequested);
Circuits\RevalidatingServerAuthenticationStateProviderTest.cs (2)
159Assert.False(firstRevalidationCall.CancellationToken.IsCancellationRequested); 168Assert.True(firstRevalidationCall.CancellationToken.IsCancellationRequested);
Microsoft.AspNetCore.Components.Tests (4)
NavigationManagerTest.cs (4)
411Assert.True(currentContext.CancellationToken.IsCancellationRequested); 450Assert.True(currentContext.CancellationToken.IsCancellationRequested); 849Assert.False(currentContext.CancellationToken.IsCancellationRequested); 857Assert.True(currentContext.CancellationToken.IsCancellationRequested);
Microsoft.AspNetCore.Components.Web (3)
Image\Image.cs (2)
191if (_activeCacheKey == source.CacheKey && !cancellationToken.IsCancellationRequested) 224if (_activeCacheKey == source.CacheKey && !cancellationToken.IsCancellationRequested)
Virtualization\Virtualize.cs (1)
422if (!cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Components.Web.Tests (1)
Image\ImageTest.cs (1)
139Assert.True(js.CapturedTokens.First().IsCancellationRequested);
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\PullFromJSDataStream.cs (2)
90if (cancellationToken.IsCancellationRequested || 91_streamCancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Components.WebView (2)
src\Components\Shared\src\PullFromJSDataStream.cs (2)
90if (cancellationToken.IsCancellationRequested || 91_streamCancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\Internal\CacheableKeyRing.cs (1)
37&& !keyRing._expirationToken.IsCancellationRequested
Microsoft.AspNetCore.DataProtection.Tests (12)
KeyManagement\XmlKeyManagerTests.cs (12)
115Assert.False(firstCancellationToken.IsCancellationRequested); 125Assert.True(firstCancellationToken.IsCancellationRequested); 126Assert.False(secondCancellationToken.IsCancellationRequested); 213Assert.False(firstCancellationToken.IsCancellationRequested); 223Assert.True(firstCancellationToken.IsCancellationRequested); 224Assert.False(secondCancellationToken.IsCancellationRequested); 641Assert.False(firstCancellationToken.IsCancellationRequested); 647Assert.True(firstCancellationToken.IsCancellationRequested); 648Assert.False(secondCancellationToken.IsCancellationRequested); 691Assert.False(firstCancellationToken.IsCancellationRequested); 700Assert.True(firstCancellationToken.IsCancellationRequested); 701Assert.False(secondCancellationToken.IsCancellationRequested);
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
120if ((ex is OperationCanceledException || ex is IOException) && context.RequestAborted.IsCancellationRequested)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
117if ((edi.SourceException is OperationCanceledException || edi.SourceException is IOException) && context.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\HttpContextStreamWriter.cs (1)
59if (_completed || _context.CancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Hosting.Tests (8)
WebHostTests.cs (8)
177Assert.True(lifetime2.ApplicationStarted.IsCancellationRequested); 186Assert.True(lifetime2.ApplicationStopped.IsCancellationRequested); 416Assert.False(applicationLifetime.ApplicationStarted.IsCancellationRequested); 417Assert.False(applicationLifetime2.ApplicationStarted.IsCancellationRequested); 420Assert.True(applicationLifetime.ApplicationStarted.IsCancellationRequested); 421Assert.True(applicationLifetime2.ApplicationStarted.IsCancellationRequested); 446Assert.True(applicationLifetime.ApplicationStarted.IsCancellationRequested); 447Assert.True(applicationLifetime2.ApplicationStarted.IsCancellationRequested);
Microsoft.AspNetCore.Http (2)
Timeouts\RequestTimeoutsMiddleware.cs (2)
89if (context.RequestAborted.IsCancellationRequested) 110when (linkedCts.IsCancellationRequested && !originalToken.IsCancellationRequested)
Microsoft.AspNetCore.Http.Connections (7)
Internal\HttpConnectionManager.cs (1)
176!connection.ConnectionClosedRequested.IsCancellationRequested)
Internal\Transports\LongPollingServerTransport.cs (3)
75if (context.RequestAborted.IsCancellationRequested) 82else if (_timeoutToken.IsCancellationRequested) 90else if (_connection?.SendingToken.IsCancellationRequested == true)
Internal\Transports\WebSocketsServerTransport.cs (2)
137while (!token.IsCancellationRequested) 184if (!_aborted && !token.IsCancellationRequested)
src\SignalR\common\Shared\PipeWriterStream.cs (1)
70if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Http.Connections.Client (3)
Internal\LongPollingTransport.cs (2)
152while (!cancellationToken.IsCancellationRequested) 181if (response.StatusCode == HttpStatusCode.NoContent || cancellationToken.IsCancellationRequested)
src\SignalR\common\Shared\PipeWriterStream.cs (1)
70if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Http.Connections.Tests (6)
HttpConnectionDispatcherTests.cs (6)
1302Assert.False(connection.SendingToken.IsCancellationRequested); 1306Assert.True(connection.SendingToken.IsCancellationRequested); 1341Assert.False(connection.SendingToken.IsCancellationRequested); 1345Assert.True(connection.SendingToken.IsCancellationRequested); 1385Assert.False(connection.SendingToken.IsCancellationRequested); 1389Assert.True(connection.SendingToken.IsCancellationRequested);
Microsoft.AspNetCore.Http.Extensions.Tests (35)
HttpResponseJsonExtensionsTests.cs (4)
335for (var i = 0; i < 100 && !cancellationToken.IsCancellationRequested; i++) 369for (var i = 0; i < 100 && !cancellationToken.IsCancellationRequested; i++) 403for (var i = 0; i < 100 && !cancellationToken.IsCancellationRequested; i++) 437for (var i = 0; i < 100 && !cancellationToken.IsCancellationRequested; i++)
RequestDelegateFactoryTests.cs (11)
794Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1618Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1703Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1787Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1817Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1847Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1877Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1904Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1944Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1973Assert.False(httpContext.RequestAborted.IsCancellationRequested); 2006Assert.False(httpContext.RequestAborted.IsCancellationRequested);
RequestDelegateGenerator\RequestDelegateCreationTests.cs (2)
284Assert.False(httpContext.RequestAborted.IsCancellationRequested); 315Assert.False(httpContext.RequestAborted.IsCancellationRequested);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (3)
938Assert.False(httpContext.RequestAborted.IsCancellationRequested); 970Assert.False(httpContext.RequestAborted.IsCancellationRequested); 1009Assert.False(httpContext.RequestAborted.IsCancellationRequested);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (1)
482Assert.False(httpContext.RequestAborted.IsCancellationRequested);
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (13)
41Assert.False(httpContext.RequestAborted.IsCancellationRequested); 104Assert.False(httpContext.RequestAborted.IsCancellationRequested); 157Assert.False(httpContext.RequestAborted.IsCancellationRequested); 194Assert.False(httpContext.RequestAborted.IsCancellationRequested); 225Assert.False(httpContext.RequestAborted.IsCancellationRequested); 274Assert.False(httpContext.RequestAborted.IsCancellationRequested); 305Assert.False(httpContext.RequestAborted.IsCancellationRequested); 353Assert.False(httpContext.RequestAborted.IsCancellationRequested); 489Assert.False(httpContext.RequestAborted.IsCancellationRequested); 525Assert.False(httpContext.RequestAborted.IsCancellationRequested); 567Assert.False(httpContext.RequestAborted.IsCancellationRequested); 605Assert.False(httpContext.RequestAborted.IsCancellationRequested); 646Assert.False(httpContext.RequestAborted.IsCancellationRequested);
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (1)
77Assert.False(httpContext.RequestAborted.IsCancellationRequested);
Microsoft.AspNetCore.HttpLogging (2)
FileLoggerProcessor.cs (2)
196if (cancellationToken.IsCancellationRequested) 262if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.Core (3)
Formatters\SystemTextJsonOutputFormatter.cs (1)
101catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { }
Infrastructure\SystemTextJsonResultExecutor.cs (2)
71catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { } 85catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.Core.Test (3)
Formatters\SystemTextJsonOutputFormatterTest.cs (1)
154if (cancellationToken.IsCancellationRequested)
Infrastructure\JsonResultExecutorTestBase.cs (2)
386for (var i = 0; i < 100000 && !cancellationToken.IsCancellationRequested; i++) 420for (var i = 0; i < 100000 && !cancellationToken.IsCancellationRequested; i++)
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerOutputFormatter.cs (1)
236if (context.HttpContext.RequestAborted.IsCancellationRequested)
XmlSerializerOutputFormatter.cs (1)
214if (context.HttpContext.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerOutputFormatterTest.cs (1)
751if (cancellationToken.IsCancellationRequested)
XmlSerializerOutputFormatterTest.cs (1)
533if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.IntegrationTests (6)
CancellationTokenModelBinderIntegrationTest.cs (6)
46Assert.False(boundPerson.Token.IsCancellationRequested); 48Assert.True(boundPerson.Token.IsCancellationRequested); 82Assert.False(boundPerson.Token.IsCancellationRequested); 84Assert.True(boundPerson.Token.IsCancellationRequested); 120Assert.False(token.IsCancellationRequested); 122Assert.True(token.IsCancellationRequested);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (4)
NewtonsoftJsonOutputFormatter.cs (2)
161catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { } 163if (context.HttpContext.RequestAborted.IsCancellationRequested)
NewtonsoftJsonResultExecutor.cs (2)
112catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { } 113if (context.HttpContext.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (2)
386for (var i = 0; i < 100000 && !cancellationToken.IsCancellationRequested; i++) 420for (var i = 0; i < 100000 && !cancellationToken.IsCancellationRequested; i++)
Microsoft.AspNetCore.OpenApi.Tests (1)
Transformers\SchemaTransformerTests.cs (1)
138Assert.True(cancellationToken.IsCancellationRequested);
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMiddleware.cs (1)
237if (ex is OperationCanceledException && context.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Server.HttpSys (9)
RequestProcessing\RequestContextOfT.cs (2)
63if ((ex is OperationCanceledException || ex is IOException) && DisconnectToken.IsCancellationRequested) 98else if ((ex is OperationCanceledException || ex is IOException) && DisconnectToken.IsCancellationRequested)
RequestProcessing\RequestStream.cs (1)
198if (cancellationToken.IsCancellationRequested)
RequestProcessing\ResponseBody.cs (5)
132if (!RequestContext.DisconnectToken.IsCancellationRequested) 334if (cancellationToken.IsCancellationRequested) 384if (cancellationToken.IsCancellationRequested) 627if (cancellationToken.IsCancellationRequested) 707if (cancellationToken.IsCancellationRequested)
RequestProcessing\ResponseStreamAsyncResult.cs (1)
238if (asyncResult._cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (11)
Listener\RequestBodyTests.cs (1)
183Assert.False(context.DisconnectToken.IsCancellationRequested);
Listener\ServerTests.cs (4)
44Assert.True(ct.IsCancellationRequested, "IsCancellationRequested"); 74Assert.False(ct.IsCancellationRequested, "IsCancellationRequested"); 95Assert.False(ct.IsCancellationRequested, "IsCancellationRequested"); 106Assert.True(ct.IsCancellationRequested, "IsCancellationRequested");
RequestTests.cs (2)
514if (!ct.CanBeCanceled || ct.IsCancellationRequested) 572result.SetResult(httpContext.RequestAborted.IsCancellationRequested);
ServerTests.cs (4)
286Assert.False(ct.IsCancellationRequested, "IsCancellationRequested"); 291Assert.True(ct.IsCancellationRequested, "IsCancellationRequested"); 319Assert.False(ct.IsCancellationRequested, "IsCancellationRequested"); 324Assert.True(ct.IsCancellationRequested, "IsCancellationRequested");
Microsoft.AspNetCore.Server.IIS (4)
Core\EmptyStream.cs (1)
71if (cancellationToken.IsCancellationRequested)
Core\HttpRequestStream.cs (1)
119if (cancellationToken.IsCancellationRequested)
Core\HttpResponseStream.cs (2)
97if (cancellationToken.IsCancellationRequested) 105if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
27if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Server.Kestrel.Core (10)
Internal\Http\Http1OutputProducer.cs (2)
98if (cancellationToken.IsCancellationRequested) 108if (cancellationToken.IsCancellationRequested)
Internal\Http2\Http2OutputProducer.cs (3)
260if (cancellationToken.IsCancellationRequested) 387if (cancellationToken.IsCancellationRequested) 523if (cancellationToken.IsCancellationRequested)
Internal\Http3\Http3Connection.cs (1)
370if (_acceptStreamsCts.Token.IsCancellationRequested)
Internal\Http3\Http3OutputProducer.cs (3)
167if (cancellationToken.IsCancellationRequested) 328if (cancellationToken.IsCancellationRequested) 353if (cancellationToken.IsCancellationRequested)
Internal\Infrastructure\TransportConnectionManager.cs (1)
96if (token.IsCancellationRequested)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (8)
Http1\Http1ConnectionTests.cs (8)
688Assert.False(original.IsCancellationRequested); 689Assert.False(_http1Connection.RequestAborted.IsCancellationRequested); 710Assert.False(original.IsCancellationRequested); 711Assert.False(_http1Connection.RequestAborted.IsCancellationRequested); 770Assert.False(original.IsCancellationRequested); 771Assert.False(_http1Connection.RequestAborted.IsCancellationRequested); 788Assert.False(original.IsCancellationRequested); 789Assert.False(_http1Connection.RequestAborted.IsCancellationRequested);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Internal\NamedPipeConnectionListener.cs (2)
127catch (IOException ex) when (!_listeningToken.IsCancellationRequested) 136catch (OperationCanceledException) when (_listeningToken.IsCancellationRequested)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicConnectionContext.cs (1)
178Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested.");
Internal\QuicConnectionListener.cs (1)
153while (!cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (6)
QuicConnectionContextTests.cs (2)
168Assert.False(serverStream.ConnectionClosed.IsCancellationRequested); 211Assert.False(serverStream.ConnectionClosed.IsCancellationRequested);
QuicConnectionListenerTests.cs (4)
57Assert.False(serverConnection.ConnectionClosed.IsCancellationRequested); 62Assert.False(serverConnection.ConnectionClosed.IsCancellationRequested); 78Assert.False(serverConnection1.ConnectionClosed.IsCancellationRequested); 103Assert.False(serverConnection2.ConnectionClosed.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 (5)
HubConnection.cs (4)
285if (_state.StopCts.Token.IsCancellationRequested) 943while (!tokenSource.Token.IsCancellationRequested && reader.TryRead(out var item)) 1462if (irq.CancellationToken.IsCancellationRequested) 1476if (irq.CancellationToken.IsCancellationRequested)
src\SignalR\common\Shared\PipeWriterStream.cs (1)
70if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.Client.Tests (1)
ServerSentEventsTransportTests.cs (1)
80if (t.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.Core (2)
DefaultHubLifetimeManager.cs (2)
58if (connection.ConnectionAborted.IsCancellationRequested) 375if (connection.ConnectionAborted.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Internal\RedisSubscriptionManager.cs (1)
21if (connection.ConnectionAborted.IsCancellationRequested)
RedisHubLifetimeManager.cs (1)
428if (connection?.ConnectionAborted.IsCancellationRequested == true)
Microsoft.AspNetCore.SignalR.Tests (7)
DefaultHubLifetimeManagerTests.cs (5)
49Assert.False(connection1.ConnectionAborted.IsCancellationRequested); 75Assert.False(connection1.ConnectionAborted.IsCancellationRequested); 171Assert.False(connection1.ConnectionAborted.IsCancellationRequested); 225Assert.False(connection1.ConnectionAborted.IsCancellationRequested); 255Assert.False(connection1.ConnectionAborted.IsCancellationRequested);
HubConnectionHandlerTestUtils\Hubs.cs (2)
1269_state.TokenStateInConnected = Context.ConnectionAborted.IsCancellationRequested; 1291_state.TokenStateInDisconnected = Context.ConnectionAborted.IsCancellationRequested;
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyLaunchManager.cs (1)
140if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxy.cs (1)
286if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.WebSockets.ConformanceTests (2)
Autobahn\AutobahnTester.cs (2)
77while (!token.IsCancellationRequested) 83if (token.IsCancellationRequested)
Microsoft.AspNetCore.WebSockets.Tests (2)
BufferStream.cs (2)
88if (cancellationToken.IsCancellationRequested) 261if (cancellationToken.IsCancellationRequested)
Microsoft.AspNetCore.WebUtilities (2)
HttpResponseStreamWriter.cs (2)
319if (cancellationToken.IsCancellationRequested) 371if (cancellationToken.IsCancellationRequested)
Microsoft.Build.Framework (5)
ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
Microsoft.Build.Tasks.CodeAnalysis (6)
src\Compilers\Shared\BuildServerConnection.cs (1)
343while (!cancellationToken.IsCancellationRequested && pipeStream.IsConnected)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.Build.Tasks.CodeAnalysis.Sdk (6)
src\Compilers\Shared\BuildServerConnection.cs (1)
343while (!cancellationToken.IsCancellationRequested && pipeStream.IsConnected)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis (6)
DiagnosticAnalyzer\AsyncQueue.cs (1)
300if (cancellationToken.IsCancellationRequested)
InternalUtilities\ExceptionExtensions.cs (1)
19=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
InternalUtilities\RoslynParallel.cs (1)
37catch (OperationCanceledException e) when (cancellationToken.IsCancellationRequested && e.CancellationToken != cancellationToken)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.Analyzers (23)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.AnalyzerUtilities (22)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.CodeStyle (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
147if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.Collections.Package (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.Contracts.Package (5)
ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.CSharp (1)
CommandLine\CSharpCommandLineParser.cs (1)
299while (!Debugger.IsAttached && !timeoutSource.Token.IsCancellationRequested)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
54if (!cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupSessionManager.cs (1)
58if (cancellationToken.IsCancellationRequested)
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandler.cs (1)
43if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.CSharp.Features (4)
LineSeparators\CSharpLineSeparatorService.cs (1)
46if (cancellationToken.IsCancellationRequested)
NavigationBar\CSharpNavigationBarItemService.cs (2)
56if (cancellationToken.IsCancellationRequested) 146if (cancellationToken.IsCancellationRequested)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
54if (!cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.Debugging.Package (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.EditorFeatures (26)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
74if (executionContext.OperationContext.UserCancellationToken.IsCancellationRequested)
DocumentationComments\AbstractXmlTagCompletionCommandHandler.cs (1)
54if (cancellationToken.IsCancellationRequested)
Formatting\FormatCommandHandler.cs (1)
106if (cancellationToken.IsCancellationRequested)
Formatting\FormatCommandHandler.Paste.cs (1)
30if (cancellationToken.IsCancellationRequested)
GoOrFind\AbstractGoOrFindNavigationService.cs (1)
171if (cancellationToken.IsCancellationRequested)
GoToDefinition\GoToDefinitionCommandHandler.cs (1)
127if (cancellationToken.IsCancellationRequested)
InlineRename\InlineRenameSession.cs (1)
562if (replacementInfo == null || cancellationToken.IsCancellationRequested)
InlineRename\UI\SmartRename\SmartRenameViewModel.cs (1)
209if (cancellationToken.IsCancellationRequested || _isDisposed)
IntelliSense\AsyncCompletion\CompletionSource.cs (1)
311AsyncCompletionLogger.LogSourceGetContextTicksDataPoint(totalStopWatch.Elapsed, isCanceled: cancellationToken.IsCancellationRequested);
IntelliSense\AsyncCompletion\ItemManager.cs (1)
156AsyncCompletionLogger.LogItemManagerUpdateDataPoint(stopwatch.Elapsed, isCanceled: cancellationToken.IsCancellationRequested);
IntelliSense\ModelComputation.cs (2)
80Contract.ThrowIfTrue(_stopCancellationToken.IsCancellationRequested); 105Contract.ThrowIfTrue(_stopCancellationToken.IsCancellationRequested, "should not chain tasks after we've been cancelled");
NavigationBar\NavigationBarController_ModelComputation.cs (2)
83if (cancellationToken.IsCancellationRequested) 128if (cancellationToken.IsCancellationRequested)
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
101if (_cancellationToken.IsCancellationRequested) 120if (_cancellationToken.IsCancellationRequested)
Suggestions\SuggestedActionsSource.cs (1)
143if (cancellationToken.IsCancellationRequested)
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (5)
247while (!cancellationToken.IsCancellationRequested) 313if (cancellationToken.IsCancellationRequested) 331if (cancellationToken.IsCancellationRequested) 339if (cancellationToken.IsCancellationRequested) 728if (_disposalTokenSource.Token.IsCancellationRequested)
Tagging\TaggerMainThreadManager.cs (1)
45if (cancellationToken.IsCancellationRequested)
Workspaces\ITextBufferVisibilityTracker.cs (3)
71task => task.Status == TaskStatus.RanToCompletion && cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : task, 80if (cancellationToken.IsCancellationRequested) 84if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Threading\TaskJoinExtensions.cs (1)
57Assert.True(cancellationToken.IsCancellationRequested);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
926catch (OperationCanceledException) when (analyzer.CancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.Extensions.Package (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (2)
Cohost\RazorStartupServiceFactory.cs (2)
101if (cancellationToken.IsCancellationRequested) return; 116if (cancellationToken.IsCancellationRequested) return;
Microsoft.CodeAnalysis.Features (25)
AddImport\AbstractAddImportFeatureService.cs (1)
102if (!cancellationToken.IsCancellationRequested)
CodeRefactorings\CodeRefactoringService.cs (2)
140if (cancellationToken.IsCancellationRequested || linkedTokenSource.Token.IsCancellationRequested)
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
44if (cancellationToken.IsCancellationRequested)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (1)
125while (!CancellationToken.IsCancellationRequested)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
162if (cancellationToken.IsCancellationRequested)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (3)
119if (CancellationToken.IsCancellationRequested) 146if (!cancellationToken.IsCancellationRequested) 162if (!processedEverything && !CancellationToken.IsCancellationRequested)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (5)
105if (CancellationToken.IsCancellationRequested) 131if (CancellationToken.IsCancellationRequested) 174if (CancellationToken.IsCancellationRequested) 221if (!cancellationToken.IsCancellationRequested) 237if (!processedEverything && !CancellationToken.IsCancellationRequested)
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (3)
69if (cancellationToken.IsCancellationRequested) 135if (cancellationToken.IsCancellationRequested) 165if (cancellationToken.IsCancellationRequested)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
30if (cancellationToken.IsCancellationRequested)
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (4)
49if (cancellationToken.IsCancellationRequested) 80if (cancellationToken.IsCancellationRequested) 92if (cancellationToken.IsCancellationRequested) 106if (cancellationToken.IsCancellationRequested)
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
155if (cancellationToken.IsCancellationRequested)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
147if (cancellationToken.IsCancellationRequested)
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (1)
116while (!cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.InteractiveHost (16)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.LanguageServer (1)
Program.cs (1)
92while (!Debugger.IsAttached && !timeoutSource.Token.IsCancellationRequested)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
486if (!cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Ordering\LongRunningNonMutatingRequestHandler.cs (1)
35if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (23)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.PooledObjects.Package (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.PublicApiAnalyzers (22)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\SolutionAssetCache.cs (1)
115while (!cancellationToken.IsCancellationRequested)
src\VisualStudio\Core\Def\Telemetry\Shared\TelemetryLogger.cs (1)
155var result = cancellationToken.IsCancellationRequested ? TelemetryResult.UserCancel : TelemetryResult.Success;
Microsoft.CodeAnalysis.Remote.Workspaces (3)
BrokeredServiceConnection.cs (2)
332Debug.Assert(cancellationToken.IsCancellationRequested); 347=> _shutdownCancellationService?.ShutdownToken.IsCancellationRequested == true;
RemoteCallback.cs (1)
217if (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
AbstractResxGenerator.cs (1)
201catch (OperationCanceledException) when (context.CancellationToken.IsCancellationRequested)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.Threading.Package (11)
AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineParser.vb (1)
463While Not Debugger.IsAttached AndAlso Not timeoutSource.Token.IsCancellationRequested
Microsoft.CodeAnalysis.Workspaces (27)
Log\EtwLogger.cs (1)
32if (cancellationToken.IsCancellationRequested)
Log\RoslynEventSource.LogBlock.cs (1)
149if (_cancellationToken.IsCancellationRequested)
Log\TraceLogger.cs (1)
29var functionString = functionId.ToString() + (cancellationToken.IsCancellationRequested ? " Canceled" : string.Empty);
Shared\TestHooks\AsynchronousOperationListener.cs (4)
45if (cancellationToken.IsCancellationRequested) 49if (expeditedDelayCancellationToken.IsCancellationRequested) 63else if (cancellationToken.IsCancellationRequested) 80else if (cancellationToken.IsCancellationRequested)
Shared\TestHooks\AsynchronousOperationListenerProvider+NullOperationListener.cs (1)
35if (cancellationToken.IsCancellationRequested)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (2)
222else if (cancellationToken.IsCancellationRequested) 457catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (7)
src\Compilers\Core\Portable\InternalUtilities\ExceptionExtensions.cs (1)
19=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Compilers\Core\Portable\InternalUtilities\RoslynParallel.cs (1)
37catch (OperationCanceledException e) when (cancellationToken.IsCancellationRequested && e.CancellationToken != cancellationToken)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CodeAnalysis.Workspaces.UnitTests (14)
UtilityTest\AsyncLazyTests.cs (1)
377while (!ct.IsCancellationRequested)
UtilityTest\CancellationSeriesTests.cs (13)
27Assert.False(token.IsCancellationRequested); 37Assert.False(token1.IsCancellationRequested); 41Assert.True(token1.IsCancellationRequested); 42Assert.False(token2.IsCancellationRequested); 46Assert.True(token2.IsCancellationRequested); 47Assert.False(token3.IsCancellationRequested); 70Assert.True(token.IsCancellationRequested); 83Assert.True(token.IsCancellationRequested); 94Assert.False(token.IsCancellationRequested); 98Assert.True(token.IsCancellationRequested); 109Assert.False(token.IsCancellationRequested); 113Assert.True(token.IsCancellationRequested); 129Assert.True(token1.IsCancellationRequested);
Microsoft.CommonLanguageServerProtocol.Framework.Example (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CommonLanguageServerProtocol.Framework.Package (6)
RequestExecutionQueue.cs (1)
486if (!cancellationToken.IsCancellationRequested)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (1)
Mocks\TestMethodHandlers.cs (1)
115if (cancellationToken.IsCancellationRequested)
Microsoft.DotNet.Helix.Sdk (1)
WaitForHelixJobCompletion.cs (1)
80if (CancelHelixJobsOnTaskCancellation && cancellationToken.IsCancellationRequested)
Microsoft.DotNet.Internal.SymbolHelper (3)
SymbolUploadHelper.cs (3)
460while (!ct.IsCancellationRequested && (outputAvailable != outputFinishedSentinel.Task || errorAvailable != outputFinishedSentinel.Task)) 481if (ct.IsCancellationRequested && !process.HasExited) 503while (!ct.IsCancellationRequested && outputTask.IsCompleted)
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
745catch (Exception e) when (!cancellationToken.IsCancellationRequested)
Microsoft.Extensions.AI.Abstractions (1)
Functions\AIFunctionFactory.cs (1)
1166if (cancellationToken.IsCancellationRequested)
Microsoft.Extensions.Caching.Hybrid (2)
Internal\DefaultHybridCache.StampedeStateT.cs (2)
209catch (OperationCanceledException) when (SharedToken.IsCancellationRequested) 285if (ex is OperationCanceledException && SharedToken.IsCancellationRequested)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
HttpExceptionSummaryProvider.cs (1)
91return ex.CancellationToken.IsCancellationRequested ? 0 : 1;
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
121catch (OperationCanceledException ex) when (!cancellationToken.IsCancellationRequested)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (3)
ApplicationLifecycleHealthCheck.cs (3)
46bool isStarted = _appLifetime.ApplicationStarted.IsCancellationRequested; 52bool isStopping = _appLifetime.ApplicationStopping.IsCancellationRequested; 58bool isStopped = _appLifetime.ApplicationStopped.IsCancellationRequested;
Microsoft.Extensions.Diagnostics.Probes (1)
TcpEndpointProbesService.cs (1)
72while (!stoppingToken.IsCancellationRequested)
Microsoft.Extensions.Hosting (2)
Internal\Host.cs (2)
191if (_applicationLifetime.ApplicationStopping.IsCancellationRequested && backgroundTask.IsCanceled && ex is OperationCanceledException) 448private bool IsRunning => _applicationLifetime.ApplicationStarted.IsCancellationRequested && !_hostStopped;
Microsoft.Extensions.Hosting.Testing.Tests (4)
FakeHostTests.cs (4)
90Assert.False(receivedToken.IsCancellationRequested); 92Assert.True(receivedToken.IsCancellationRequested); 150Assert.False(receivedToken.IsCancellationRequested); 152Assert.True(receivedToken.IsCancellationRequested);
Microsoft.Extensions.Http.Diagnostics (3)
Logging\Internal\HttpRequestBodyReader.cs (1)
70catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
Logging\Internal\HttpResponseBodyReader.cs (1)
85catch (OperationCanceledException) when (joinedTokenSource.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
src\LegacySupport\TaskWaitAsync\TaskExtensions.cs (1)
29if (cancellationToken.IsCancellationRequested)
Microsoft.Extensions.Http.Diagnostics.Tests (4)
Logging\HttpRequestBodyReaderTest.cs (1)
117.Where(e => e.CancellationToken.IsCancellationRequested);
Logging\HttpResponseBodyReaderTest.cs (3)
138await act.Should().ThrowAsync<TaskCanceledException>().Where(e => e.CancellationToken.IsCancellationRequested); 201await act.Should().ThrowAsync<OperationCanceledException>().Where(e => e.CancellationToken.IsCancellationRequested); 257await act.Should().ThrowAsync<OperationCanceledException>().Where(e => e.CancellationToken.IsCancellationRequested);
Microsoft.Extensions.Http.Resilience (1)
Polly\HttpClientResiliencePredicates.cs (1)
54=> !cancellationToken.IsCancellationRequested
Microsoft.Extensions.Options.Contextual (1)
Internal\ContextualOptionsFactory.cs (1)
102if (!cancellationToken.IsCancellationRequested)
Microsoft.Extensions.Primitives (2)
CancellationChangeToken.cs (1)
30public bool HasChanged => Token.IsCancellationRequested;
CompositeChangeToken.cs (1)
66if (_cancellationTokenSource != null && _cancellationTokenSource.Token.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery.Dns (4)
Resolver\DnsResolver.cs (4)
393catch (Exception ex) when (!cancellationToken.IsCancellationRequested) 475!cancellationToken.IsCancellationRequested && // not cancelled by the caller 479Debug.Assert(cts.Token.IsCancellationRequested); 482catch (OperationCanceledException ex) when (cancellationToken.IsCancellationRequested && ex.CancellationToken != cancellationToken)
Microsoft.Extensions.ServiceDiscovery.Tests (3)
ServiceEndpointResolverTests.cs (3)
95if (cts[0].Token.IsCancellationRequested) 147if (cts[0].Token.IsCancellationRequested) 183if (cts[0].Token.IsCancellationRequested)
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
FakeTimeProviderTests.cs (1)
340Assert.False(cancellationTokenSource.Token.IsCancellationRequested);
Microsoft.JSInterop (1)
JSRuntime.cs (1)
145if (cancellationToken.IsCancellationRequested)
Microsoft.ML.AutoML (6)
API\BinaryClassificationExperiment.cs (1)
460catch (Exception ex) when (ct.IsCancellationRequested)
API\MulticlassClassificationExperiment.cs (1)
438catch (Exception ex) when (ct.IsCancellationRequested)
API\RegressionExperiment.cs (1)
453catch (Exception ex) when (ct.IsCancellationRequested)
AutoMLExperiment\IStopTrainingManager.cs (1)
43if (_token.IsCancellationRequested)
AutoMLExperiment\Runner\SweepablePipelineRunner.cs (1)
106catch (Exception ex) when (ct.IsCancellationRequested)
Experiment\Experiment.cs (1)
218!_experimentSettings.CancellationToken.IsCancellationRequested &&
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
284if (ct.IsCancellationRequested)
Microsoft.ML.GenAI.Core (1)
Trainer\CausalLMSupervisedFineTuningTrainer.cs (1)
46if (ct.IsCancellationRequested)
Microsoft.ML.Maml (1)
MAML.cs (1)
212while (!ct.IsCancellationRequested)
Microsoft.VisualStudio.LanguageServices (3)
RoslynActivityLogger.cs (1)
71=> TraceSource.TraceData(TraceEventType.Verbose, EndEventId, functionId.Convert(), uniquePairId, cancellationToken.IsCancellationRequested, delta, logMessage.GetMessage());
Telemetry\FileLogger.cs (1)
91=> LogBlockEvent(functionId, logMessage, uniquePairId, cancellationToken.IsCancellationRequested ? "BlockCancelled" : "BlockEnd");
Telemetry\Shared\TelemetryLogger.cs (1)
155var result = cancellationToken.IsCancellationRequested ? TelemetryResult.UserCancel : TelemetryResult.Success;
Microsoft.VisualStudio.LanguageServices.DevKit (2)
Logging\VSCodeTelemetryLogger.cs (1)
90var result = cancellationToken.IsCancellationRequested ? TelemetryResult.UserCancel : TelemetryResult.Success;
src\VisualStudio\Core\Def\Telemetry\Shared\TelemetryLogger.cs (1)
155var result = cancellationToken.IsCancellationRequested ? TelemetryResult.UserCancel : TelemetryResult.Success;
Microsoft.VisualStudio.LanguageServices.Implementation (1)
CodeModel\ProjectCodeModelFactory.cs (1)
155if (cancellationToken.IsCancellationRequested)
Producer (1)
IntermittentProducerWorker.cs (1)
13while (!stoppingToken.IsCancellationRequested)
Replay (6)
src\Compilers\Shared\BuildServerConnection.cs (1)
343while (!cancellationToken.IsCancellationRequested && pipeStream.IsConnected)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
Roslyn.Diagnostics.Analyzers (23)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Loggers\OutputWindowLogger.cs (1)
45var functionString = functionId.ToString() + (cancellationToken.IsCancellationRequested ? " Canceled" : string.Empty);
Roslyn.VisualStudio.Next.UnitTests (1)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
130Assert.True(ex is OperationCanceledException, $"cancellationToken : {source.Token.IsCancellationRequested}/r/n{ex}");
RunTests (1)
Program.cs (1)
254catch (Exception ex) when (!cancellationToken.IsCancellationRequested)
SemanticSearch.BuildTask (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
ServiceBusWorker (1)
Producer.cs (1)
15while (!cancellationToken.IsCancellationRequested)
SignalRServerlessWeb (1)
Program.cs (1)
57while (!stoppingToken.IsCancellationRequested)
Stress.TelemetryService (1)
TelemetryStresser.cs (1)
31while (!cancellationToken.IsCancellationRequested)
System.Console (2)
System\IO\SyncTextReader.cs (2)
101return cancellationToken.IsCancellationRequested ? 113return cancellationToken.IsCancellationRequested ?
System.Data.Common (21)
System\Data\Common\DbCommand.cs (4)
123if (cancellationToken.IsCancellationRequested) 164if (cancellationToken.IsCancellationRequested) 196if (cancellationToken.IsCancellationRequested) 229if (cancellationToken.IsCancellationRequested)
System\Data\Common\DbConnection.cs (6)
69if (cancellationToken.IsCancellationRequested) 115if (cancellationToken.IsCancellationRequested) 231if (cancellationToken.IsCancellationRequested) 263if (cancellationToken.IsCancellationRequested) 295if (cancellationToken.IsCancellationRequested) 326if (cancellationToken.IsCancellationRequested)
System\Data\Common\DbDataReader.cs (6)
105if (cancellationToken.IsCancellationRequested) 135if (cancellationToken.IsCancellationRequested) 252if (cancellationToken.IsCancellationRequested) 277if (cancellationToken.IsCancellationRequested) 302if (cancellationToken.IsCancellationRequested) 323if (cancellationToken.IsCancellationRequested)
System\Data\Common\DbTransaction.cs (5)
25if (cancellationToken.IsCancellationRequested) 55if (cancellationToken.IsCancellationRequested) 96if (cancellationToken.IsCancellationRequested) 122if (cancellationToken.IsCancellationRequested) 149if (cancellationToken.IsCancellationRequested)
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\Metrics\AggregationManager.cs (2)
263while (!_cts.Token.IsCancellationRequested) 294if (cancelToken.IsCancellationRequested)
System.Diagnostics.Process (1)
System\Diagnostics\ProcessWaitState.Unix.cs (1)
521while (!cancellationToken.IsCancellationRequested)
System.Formats.Tar (15)
System\Formats\Tar\SeekableSubReadStream.cs (1)
72if (cancellationToken.IsCancellationRequested)
System\Formats\Tar\SubReadStream.cs (3)
130if (cancellationToken.IsCancellationRequested) 140if (cancellationToken.IsCancellationRequested) 173cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) :
System\Formats\Tar\TarEntry.cs (3)
232if (cancellationToken.IsCancellationRequested) 323if (cancellationToken.IsCancellationRequested) 423if (cancellationToken.IsCancellationRequested)
System\Formats\Tar\TarFile.cs (4)
68if (cancellationToken.IsCancellationRequested) 135if (cancellationToken.IsCancellationRequested) 214if (cancellationToken.IsCancellationRequested) 299if (cancellationToken.IsCancellationRequested)
System\Formats\Tar\TarHeader.Write.cs (1)
204if (cancellationToken.IsCancellationRequested)
System\Formats\Tar\TarReader.cs (1)
177if (cancellationToken.IsCancellationRequested)
System\Formats\Tar\TarWriter.cs (2)
165if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested)
System.IO.Compression (6)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (2)
80return cancellationToken.IsCancellationRequested ? 162if (cancellationToken.IsCancellationRequested)
System\IO\Compression\DeflateZLib\DeflateStream.cs (4)
209if (cancellationToken.IsCancellationRequested) 429if (cancellationToken.IsCancellationRequested) 837cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled(cancellationToken) : 898if (cancellationToken.IsCancellationRequested)
System.IO.Compression.Brotli (3)
System\IO\Compression\dec\BrotliStream.Decompress.cs (1)
139if (cancellationToken.IsCancellationRequested)
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
150return cancellationToken.IsCancellationRequested ? 219if (cancellationToken.IsCancellationRequested)
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.Linux.cs (1)
777while (!_cancellationToken.IsCancellationRequested && TryReadEvent(out nextEvent))
System.IO.Pipelines (12)
System\IO\Pipelines\Pipe.cs (4)
365if (cancellationToken.IsCancellationRequested) 689if (token.IsCancellationRequested) 748if (token.IsCancellationRequested) 1064if (cancellationToken.IsCancellationRequested)
System\IO\Pipelines\PipeAwaitable.cs (1)
157if (CancellationToken.IsCancellationRequested)
System\IO\Pipelines\PipeReader.cs (2)
184if (cancellationToken.IsCancellationRequested) 206if (cancellationToken.IsCancellationRequested)
System\IO\Pipelines\StreamPipeExtensions.cs (1)
28if (cancellationToken.IsCancellationRequested)
System\IO\Pipelines\StreamPipeReader.cs (2)
216if (cancellationToken.IsCancellationRequested) 289if (cancellationToken.IsCancellationRequested)
System\IO\Pipelines\StreamPipeWriter.cs (2)
364if (localToken.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
System.IO.Pipes (7)
System\IO\Pipes\NamedPipeClientStream.cs (1)
187if (cancellationToken.IsCancellationRequested)
System\IO\Pipes\NamedPipeServerStream.Unix.cs (2)
76return cancellationToken.IsCancellationRequested ? 88catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
System\IO\Pipes\PipeStream.Unix.cs (4)
66if (cancellationToken.IsCancellationRequested) 89if (cancellationToken.IsCancellationRequested) 142if (cancellationToken.IsCancellationRequested) 164if (cancellationToken.IsCancellationRequested)
System.Linq.Parallel (15)
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (1)
354if (_mergeHelper._taskGroupState.CancellationState.MergedCancellationToken.IsCancellationRequested)
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (1)
73&& SpecifiedQuerySettings.CancellationState.ExternalCancellationToken.IsCancellationRequested)
System\Linq\Parallel\QueryOperators\QueryOperator.cs (2)
144if (querySettings.CancellationState.MergedCancellationToken.IsCancellationRequested) 214if (querySettings.CancellationState.MergedCancellationToken.IsCancellationRequested)
System\Linq\Parallel\Scheduling\CancellationState.cs (1)
73if (externalCancellationToken.IsCancellationRequested)
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
115if (cancelToken.IsCancellationRequested)
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
137if (!_groupState.CancellationState.MergedCancellationToken.IsCancellationRequested)
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
120!oce.CancellationToken.IsCancellationRequested || 139if (_cancellationState.MergedCancellationToken.IsCancellationRequested)
System\Linq\Parallel\Scheduling\SpoolingTask.cs (2)
232if (cancelToken.IsCancellationRequested) 320if (cancelToken.IsCancellationRequested)
System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs (1)
53&& _groupState.CancellationState.MergedCancellationToken.IsCancellationRequested)
System\Linq\Parallel\Utils\ExceptionAggregator.cs (3)
149&& cancellationState.ExternalCancellationToken.IsCancellationRequested) 156&& cancellationState.MergedCancellationToken.IsCancellationRequested 157&& cancellationState.ExternalCancellationToken.IsCancellationRequested)
System.Memory.Data (2)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
130return cancellationToken.IsCancellationRequested ? 139return cancellationToken.IsCancellationRequested ?
System.Net.Http (30)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
130return cancellationToken.IsCancellationRequested ? 139return cancellationToken.IsCancellationRequested ?
System\Net\Http\CancellationHelper.cs (2)
20!(exception is OperationCanceledException) && cancellationToken.IsCancellationRequested; 47if (cancellationToken.IsCancellationRequested)
System\Net\Http\EmptyContent.cs (2)
26cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 36cancellationToken.IsCancellationRequested ? Task.FromCanceled<Stream>(cancellationToken) :
System\Net\Http\EmptyReadStream.cs (1)
25cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<int>(cancellationToken) :
System\Net\Http\HttpBaseStream.cs (1)
80cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) :
System\Net\Http\HttpClient.cs (3)
585if (cancellationToken.IsCancellationRequested) 603if (!cancellationToken.IsCancellationRequested) 614e = toThrow = CancellationHelper.CreateOperationCanceledException(e, cancellationToken.IsCancellationRequested ? cancellationToken : cts.Token);
System\Net\Http\MessageProcessingHandler.cs (1)
124if (cancellationToken.IsCancellationRequested && (e.CancellationToken == cancellationToken))
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (2)
121if (cancellationToken.IsCancellationRequested) 249cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) :
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
103if (cancellationToken.IsCancellationRequested)
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (1)
94if (cancellationToken.IsCancellationRequested)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (2)
551http11ConnectionWaiter?.SetTimeoutToPendingConnectionAttempt(this, cancellationToken.IsCancellationRequested); 552http2ConnectionWaiter?.SetTimeoutToPendingConnectionAttempt(this, cancellationToken.IsCancellationRequested);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
123http3ConnectionWaiter?.SetTimeoutToPendingConnectionAttempt(this, cancellationToken.IsCancellationRequested);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
123if (cancellationToken.IsCancellationRequested)
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (3)
1614if (cancellationToken.IsCancellationRequested) 1635cancellationToken.IsCancellationRequested ? Task.FromCanceled<int>(cancellationToken) : 1654if (cancellationToken.IsCancellationRequested)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (3)
323catch (QuicException ex) when (ex.QuicError == QuicError.OperationAborted && cancellationToken.IsCancellationRequested) 348if (cancellationToken.IsCancellationRequested) 1372case QuicException e when (e.QuicError == QuicError.OperationAborted && cancellationToken.IsCancellationRequested):
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (3)
96if (cancellationToken.IsCancellationRequested) 166if (cancellationToken.IsCancellationRequested) 192if (cancellationToken.IsCancellationRequested)
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
608if (cancellationToken.IsCancellationRequested)
System.Net.Http.Json (2)
System\Net\Http\Json\HttpClientJsonExtensions.cs (2)
93catch (OperationCanceledException oce) when ((linkedCTS?.Token.IsCancellationRequested == true) && !cancellationToken.IsCancellationRequested)
System.Net.Mail (1)
System\Net\Mail\SmtpClient.cs (1)
658if (cancellationToken.IsCancellationRequested)
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
555if (cancellationToken.IsCancellationRequested)
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.PingUtility.cs (1)
89catch (OperationCanceledException) when (timeoutOrCancellationToken.IsCancellationRequested)
System.Net.Quic (5)
src\libraries\Common\src\System\Net\StreamBuffer.cs (1)
323Debug.Assert(cancellationToken.IsCancellationRequested);
System\Net\Quic\QuicListener.cs (3)
267catch (OperationCanceledException oce) when (cancellationToken.IsCancellationRequested && !connection.ConnectionShutdownToken.IsCancellationRequested) 291if (wrapException && connection.ConnectionShutdownToken.IsCancellationRequested)
System\Net\Quic\QuicStream.cs (1)
377if (_sendTcs.IsCompleted && cancellationToken.IsCancellationRequested)
System.Net.Requests (1)
System\Net\RequestBufferingStream.cs (1)
31return cancellationToken.IsCancellationRequested ?
System.Net.Security (2)
System\Net\Security\SslStream.IO.cs (2)
978if (e is IOException || (e is OperationCanceledException && cancellationToken.IsCancellationRequested)) 1026if (e is IOException || (e is OperationCanceledException && cancellationToken.IsCancellationRequested))
System.Net.Sockets (13)
System\Net\Sockets\Socket.Tasks.cs (12)
56if (cancellationToken.IsCancellationRequested) 88if (cancellationToken.IsCancellationRequested) 230if (cancellationToken.IsCancellationRequested) 288if (cancellationToken.IsCancellationRequested) 378if (cancellationToken.IsCancellationRequested) 418if (cancellationToken.IsCancellationRequested) 479if (cancellationToken.IsCancellationRequested) 534if (cancellationToken.IsCancellationRequested) 552if (cancellationToken.IsCancellationRequested) 642if (cancellationToken.IsCancellationRequested) 672if (cancellationToken.IsCancellationRequested) 727if (cancellationToken.IsCancellationRequested)
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
795if (cancellationToken.IsCancellationRequested)
System.Net.WebClient (3)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (2)
65if (cancellationToken.IsCancellationRequested) 76if (cancellationToken.IsCancellationRequested)
src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (1)
90SetException(token.IsCancellationRequested ? new OperationCanceledException(token) : new OperationCanceledException());
System.Net.WebSockets (5)
System\Net\WebSockets\AsyncMutex.cs (2)
59if (cancellationToken.IsCancellationRequested) 104if (cancellationToken.IsCancellationRequested)
System\Net\WebSockets\WebSocketStream.cs (3)
121cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 207if (cancellationToken.IsCancellationRequested) 309if (cancellationToken.IsCancellationRequested)
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
217(exc is OperationCanceledException && cancellationToken.IsCancellationRequested))
System.Private.CoreLib (114)
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (1)
89if (_cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\CodeDom\Compiler\IndentedTextWriter.cs (1)
67cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) :
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
156while (!token.IsCancellationRequested && EventPipeInternal.GetNextEvent(sessionID, &instanceData))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (2)
27while (!token.IsCancellationRequested) 32if (!token.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (5)
305if (cancellationToken.IsCancellationRequested) 578if (cancellationToken.IsCancellationRequested) 630if (cancellationToken.IsCancellationRequested) 1007if (cancellationToken.IsCancellationRequested) 1279return cancellationToken.IsCancellationRequested ?
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (8)
851return cancellationToken.IsCancellationRequested 1090return cancellationToken.IsCancellationRequested 1160if (cancellationToken.IsCancellationRequested) 1170if (cancellationToken.IsCancellationRequested) 1280return cancellationToken.IsCancellationRequested 1298return cancellationToken.IsCancellationRequested 1333if (cancellationToken.IsCancellationRequested) 1399if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (5)
266if (cancellationToken.IsCancellationRequested) 291if (cancellationToken.IsCancellationRequested) 310if (cancellationToken.IsCancellationRequested) 340if (cancellationToken.IsCancellationRequested) 359if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (6)
165if (cancellationToken.IsCancellationRequested) 372if (cancellationToken.IsCancellationRequested) 392if (cancellationToken.IsCancellationRequested) 481if (cancellationToken.IsCancellationRequested) 667if (cancellationToken.IsCancellationRequested) 687if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.cs (4)
117if (cancellationToken.IsCancellationRequested) 146if (cancellationToken.IsCancellationRequested) 217if (cancellationToken.IsCancellationRequested) 246if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (4)
294if (cancellationToken.IsCancellationRequested) 591if (cancellationToken.IsCancellationRequested) 785if (cancellationToken.IsCancellationRequested) 837return cancellationToken.IsCancellationRequested ?
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (8)
304cancellationToken.IsCancellationRequested ? 726cancellationToken.IsCancellationRequested ? 1017cancellationToken.IsCancellationRequested ? 1029cancellationToken.IsCancellationRequested ? 1050cancellationToken.IsCancellationRequested ? 1055cancellationToken.IsCancellationRequested ? 1066cancellationToken.IsCancellationRequested ? 1071cancellationToken.IsCancellationRequested ?
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (7)
1087if (cancellationToken.IsCancellationRequested) 1299if (cancellationToken.IsCancellationRequested) 1430cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<int>(cancellationToken) : default; 1439cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<int>(cancellationToken) : default; 1446cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<string?>(cancellationToken) : default; 1453cancellationToken.IsCancellationRequested ? Task.FromCanceled<string>(cancellationToken) : Task.FromResult(""); 1456cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<int>(cancellationToken) : default;
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (4)
769if (cancellationToken.IsCancellationRequested) 920if (cancellationToken.IsCancellationRequested) 950if (cancellationToken.IsCancellationRequested) 965if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (4)
248cancellationToken.IsCancellationRequested 283cancellationToken.IsCancellationRequested 302cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<int>(cancellationToken) : 320cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<int>(cancellationToken) :
src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (4)
216if (cancellationToken.IsCancellationRequested) 234if (cancellationToken.IsCancellationRequested) 269if (cancellationToken.IsCancellationRequested) 292if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (2)
380=> cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<string?>(cancellationToken) : new ValueTask<string?>(ReadLine()); 387=> cancellationToken.IsCancellationRequested ? Task.FromCanceled<string>(cancellationToken) : Task.FromResult(ReadToEnd());
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (10)
561cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 592cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 624cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 656cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 685cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 956if (cancellationToken.IsCancellationRequested) 975if (cancellationToken.IsCancellationRequested) 987if (cancellationToken.IsCancellationRequested) 1020if (cancellationToken.IsCancellationRequested) 1046if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (5)
235if (cancellationToken.IsCancellationRequested) 425if (cancellationToken.IsCancellationRequested) 447if (cancellationToken.IsCancellationRequested) 702if (cancellationToken.IsCancellationRequested) 724if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
371if (cancellationToken.IsCancellationRequested) 547if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationToken.cs (6)
72/// into a canceled state, meaning that <see cref="IsCancellationRequested"/> will never 107/// both <see cref="CanBeCanceled"/> and <see cref="IsCancellationRequested"/> will be false. 109/// both <see cref="CanBeCanceled"/> and <see cref="IsCancellationRequested"/> will be true. 305/// from public CancellationToken constructors and their <see cref="IsCancellationRequested"/> values are equal.</returns> 316/// from public CancellationToken constructors and their <see cref="IsCancellationRequested"/> values are equal.</returns> 361if (IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (3)
234/// and will transition to a state where <see cref="CancellationToken.IsCancellationRequested"/> returns true. 256/// <see cref="CancellationToken.IsCancellationRequested"/> returns true. Any callbacks or cancelable operations registered 290/// and will synchronously transition to a state where <see cref="CancellationToken.IsCancellationRequested"/> returns true.
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (2)
199if (cancellationToken.IsCancellationRequested) 247if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (2)
688if (cancellationToken.IsCancellationRequested) 786if (cancellationToken.IsCancellationRequested)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (2)
593if (cancellationToken.IsCancellationRequested) 1429public bool CancellationPending => (m_task.Status == TaskStatus.WaitingToRun) && m_task.CancellationToken.IsCancellationRequested;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (4)
1615if (cancellationToken.IsCancellationRequested 1662if (cancellationToken.IsCancellationRequested 1986if (cancellationToken.IsCancellationRequested 2036if (cancellationToken.IsCancellationRequested
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (10)
621if (cancellationToken.IsCancellationRequested) 1320props.m_cancellationToken.IsCancellationRequested); 2839if (cancellationToken.IsCancellationRequested) 4464if (IsCompleted || cancellationToken.IsCancellationRequested) 5470if (!cancellationToken.IsCancellationRequested) 5481if (!cancellationToken.IsCancellationRequested) 5613if (cancellationToken.IsCancellationRequested) 5657if (cancellationToken.IsCancellationRequested) 5774cancellationToken.IsCancellationRequested ? FromCanceled(cancellationToken) : 7169public bool CancellationPending => (m_task.Status == TaskStatus.WaitingToRun) && m_task.CancellationToken.IsCancellationRequested;
src\System\Runtime\ControlledExecution.CoreCLR.cs (2)
101OperationCanceledException e = cancellationToken.IsCancellationRequested ? new(cancellationToken) : new(); 113if (cancellationToken.IsCancellationRequested)
System.Private.Xml.Linq (11)
System\Xml\Linq\XCData.cs (1)
71if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XComment.cs (1)
112if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XDocument.cs (2)
457if (cancellationToken.IsCancellationRequested) 829if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XDocumentType.cs (1)
164if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XElement.cs (3)
839if (cancellationToken.IsCancellationRequested) 1181if (cancellationToken.IsCancellationRequested) 1319if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XNode.cs (1)
465if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XProcessingInstruction.cs (1)
138if (cancellationToken.IsCancellationRequested)
System\Xml\Linq\XText.cs (1)
110if (cancellationToken.IsCancellationRequested)
System.Security.Cryptography (10)
System\Security\Cryptography\CryptoStream.cs (2)
129if (cancellationToken.IsCancellationRequested) 201return cancellationToken.IsCancellationRequested ?
System\Security\Cryptography\LiteHashProvider.cs (4)
34if (cancellationToken.IsCancellationRequested) 48if (cancellationToken.IsCancellationRequested) 87if (cancellationToken.IsCancellationRequested) 102if (cancellationToken.IsCancellationRequested)
System\Security\Cryptography\LiteHashProvider.Xof.cs (4)
63if (cancellationToken.IsCancellationRequested) 78if (cancellationToken.IsCancellationRequested) 96if (cancellationToken.IsCancellationRequested) 114if (cancellationToken.IsCancellationRequested)
System.ServiceModel.Http (7)
System\ServiceModel\Channels\HttpChannelFactory.cs (2)
1072if (timeoutToken.IsCancellationRequested) 1142if (cancelToken.IsCancellationRequested)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (5)
128if (cancelToken.IsCancellationRequested) 994if (cancelToken.IsCancellationRequested) 1041if (cancellationToken.IsCancellationRequested) 1121if (cancellationToken.IsCancellationRequested) 1195if (cancelTokenTask.Result.IsCancellationRequested)
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Channels\StreamedFramingRequestChannel.cs (1)
273if (cancelToken.IsCancellationRequested)
System.ServiceModel.Primitives (3)
System\ServiceModel\Channels\BufferedReadStream.cs (1)
310if (cancellationToken.IsCancellationRequested)
System\ServiceModel\Channels\BufferedWriteStream.cs (2)
176if (cancellationToken.IsCancellationRequested) 412if (cancellationToken.IsCancellationRequested)
System.Threading.Channels (23)
System\Threading\Channels\BoundedChannel.cs (4)
149if (cancellationToken.IsCancellationRequested) 192if (cancellationToken.IsCancellationRequested) 469if (cancellationToken.IsCancellationRequested) 517if (cancellationToken.IsCancellationRequested)
System\Threading\Channels\ChannelReader.cs (1)
60if (cancellationToken.IsCancellationRequested)
System\Threading\Channels\ChannelUtilities.cs (1)
63error is OperationCanceledException oce ? Task.FromCanceled<T>(oce.CancellationToken.IsCancellationRequested ? oce.CancellationToken : new CancellationToken(true)) :
System\Threading\Channels\ChannelWriter.cs (1)
44cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled<T>(cancellationToken)) :
System\Threading\Channels\RendezvousChannel.cs (4)
134if (cancellationToken.IsCancellationRequested) 189if (cancellationToken.IsCancellationRequested) 338if (cancellationToken.IsCancellationRequested) 376if (cancellationToken.IsCancellationRequested)
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (4)
72if (cancellationToken.IsCancellationRequested) 143if (cancellationToken.IsCancellationRequested) 342cancellationToken.IsCancellationRequested ? new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)) : 351cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled(cancellationToken)) :
System\Threading\Channels\UnboundedChannel.cs (4)
70if (cancellationToken.IsCancellationRequested) 138if (cancellationToken.IsCancellationRequested) 281cancellationToken.IsCancellationRequested ? new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)) : 288cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled(cancellationToken)) :
System\Threading\Channels\UnboundedPriorityChannel.cs (4)
77if (cancellationToken.IsCancellationRequested) 149if (cancellationToken.IsCancellationRequested) 287cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled<bool>(cancellationToken) : 294cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled(cancellationToken) :
System.Threading.RateLimiting (2)
System\Threading\RateLimiting\PartitionedRateLimiter.T.cs (1)
66if (cancellationToken.IsCancellationRequested)
System\Threading\RateLimiting\RateLimiter.cs (1)
103if (cancellationToken.IsCancellationRequested)
System.Threading.Tasks.Dataflow (19)
Base\DataflowBlock.cs (6)
291if (cancellationToken.IsCancellationRequested) 700if (_cancellationToken.IsCancellationRequested) 977if (cancellationToken.IsCancellationRequested) 1273(_externalCancellationToken.IsCancellationRequested || _cts.IsCancellationRequested)) 1406cancellationToken.IsCancellationRequested ? Common.CreateTaskFromCancellation<bool>(cancellationToken) : 1832if (dataflowBlockOptions.CancellationToken.IsCancellationRequested)
Blocks\BatchBlock.cs (2)
332if (!_decliningPermanently && !_dataflowBlockOptions.CancellationToken.IsCancellationRequested) 480return _dataflowBlockOptions.CancellationToken.IsCancellationRequested || _owningBatch._source.HasExceptions;
Blocks\BroadcastBlock.cs (2)
983else if (_dataflowBlockOptions.CancellationToken.IsCancellationRequested) 1141return _dataflowBlockOptions.CancellationToken.IsCancellationRequested ||
Blocks\JoinBlock.cs (1)
1224return _dataflowBlockOptions.CancellationToken.IsCancellationRequested || _hasExceptions;
Blocks\WriteOnceBlock.cs (2)
84if (dataflowBlockOptions.CancellationToken.IsCancellationRequested) 180else if (_dataflowBlockOptions.CancellationToken.IsCancellationRequested)
Internal\Common.cs (2)
181if (cancellationToken.IsCancellationRequested) 374Debug.Assert(cancellationToken.IsCancellationRequested,
Internal\SourceCore.cs (2)
878return _dataflowBlockOptions.CancellationToken.IsCancellationRequested || 957else if (_dataflowBlockOptions.CancellationToken.IsCancellationRequested)
Internal\TargetCore.cs (2)
708return _dataflowBlockOptions.CancellationToken.IsCancellationRequested || Volatile.Read(ref _exceptions) != null; 784else if (_dataflowBlockOptions.CancellationToken.IsCancellationRequested)
System.Threading.Tasks.Parallel (5)
System\Threading\Tasks\Parallel.cs (1)
2814if (!cancelToken.IsCancellationRequested)
System\Threading\Tasks\Parallel.ForEachAsync.cs (4)
85if (cancellationToken.IsCancellationRequested) 254if (cancellationToken.IsCancellationRequested) 409if (cancellationToken.IsCancellationRequested) 644if (_externalCancellationToken.IsCancellationRequested)
System.Windows.Forms (8)
System\Windows\Forms\Control_InvokeAsync.cs (8)
59if (cancellationToken.IsCancellationRequested) 78if (cancellationToken.IsCancellationRequested) 184if (cancellationToken.IsCancellationRequested) 203if (cancellationToken.IsCancellationRequested) 285if (cancellationToken.IsCancellationRequested) 307if (cancellationToken.IsCancellationRequested) 390if (cancellationToken.IsCancellationRequested) 412if (cancellationToken.IsCancellationRequested)
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
211if (cancellationToken.IsCancellationRequested)
Test.Utilities (18)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
TestProject.WorkerA (1)
Worker.cs (1)
19while (!stoppingToken.IsCancellationRequested)
Text.Analyzers (23)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
131/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 140/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param> 206/// <see cref="CancellationToken.IsCancellationRequested"/>. Unexpected cancellation, i.e. an 215/// <see cref="CancellationToken.IsCancellationRequested"/> set if cancellation is expected.</param>
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
40=> exception is OperationCanceledException && cancellationToken.IsCancellationRequested;
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (6)
26/// cref="CancellationToken.IsCancellationRequested"/>. 155if (_entireQueueCancellationToken.IsCancellationRequested) 206if (_entireQueueCancellationToken.IsCancellationRequested) 217if (_entireQueueCancellationToken.IsCancellationRequested) 240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested); 262else if (batchResultTask.IsCanceled && !_entireQueueCancellationToken.IsCancellationRequested)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (3)
116if (cancellationToken.IsCancellationRequested) 281if (cancellationToken.IsCancellationRequested) 531if (_externalCancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
256if (context.CancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
41if (cancellationToken.IsCancellationRequested)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
36if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
66if (cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
329if (cancellationToken.IsCancellationRequested) 573if (task.IsCanceled || _cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (2)
137if (cancellationToken.IsCancellationRequested) 142else if (intermediateResult.IsCanceled && cancellationToken.IsCancellationRequested)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
107if (cancellationToken.IsCancellationRequested)
vbc (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
343while (!cancellationToken.IsCancellationRequested && pipeStream.IsConnected)
VBCSCompiler (3)
src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
173while (!cancellationToken.IsCancellationRequested)
src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (1)
145if (cancellationToken.IsCancellationRequested)
src\Compilers\Shared\BuildServerConnection.cs (1)
343while (!cancellationToken.IsCancellationRequested && pipeStream.IsConnected)
VBCSCompiler.UnitTests (1)
ClientConnectionHandlerTests.cs (1)
156Assert.True(cancellationToken.IsCancellationRequested);
Wasm.Performance.Driver (1)
Program.cs (1)
117} while (isStressRun && !stressRunCancellation.IsCancellationRequested);
WebPubSubWeb (1)
Program.cs (1)
82while (!stoppingToken.IsCancellationRequested)
WebTransportInteractiveSampleApp (2)
Program.cs (2)
99while (!stream.ConnectionClosed.IsCancellationRequested) 120while (!stream.ConnectionClosed.IsCancellationRequested)