6 types derived from TaskScheduler
Microsoft.CodeAnalysis.EditorFeatures (1)
Shared\Utilities\ThreadingContextTaskSchedulerProvider.cs (1)
24private sealed class JoinableTaskFactoryTaskScheduler(JoinableTaskFactory joinableTaskFactory) : TaskScheduler
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Threading\SynchronizationContextTaskScheduler.cs (1)
15internal sealed class SynchronizationContextTaskScheduler : TaskScheduler
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
TestExportJoinableTaskContext.cs (1)
132private sealed class JoinableTaskFactoryTaskScheduler : TaskScheduler
System.Private.CoreLib (3)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
507private sealed class ConcurrentExclusiveTaskScheduler : TaskScheduler
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (1)
536internal sealed class SynchronizationContextTaskScheduler : TaskScheduler
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
21internal sealed class ThreadPoolTaskScheduler : TaskScheduler
942 references to TaskScheduler
Aspire.Hosting (1)
Dcp\Process\ProcessUtil.cs (1)
110}, TaskScheduler.Default);
Aspire.Hosting.Azure (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
110}, TaskScheduler.Default);
BuildActionTelemetryTable (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Client.ChannelLayer.IntegrationTests (2)
DuplexChannelWithSynchronizationContext.cs (2)
155Task.Factory.StartNew(() => SingleThreadedSyncContext_CallbackUsingDefaultSyncCtx_SyncCallNotBlocked_Helper(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 220Task.Factory.StartNew(() => SingleThreadedSyncContext_SyncCallNotBlocked_Helper(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
Client.TypedClient.IntegrationTests (5)
TypedProxyTests.4.0.0.cs (3)
72Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_AsyncBeginEnd_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 106Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_AsyncTask_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 160Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_Synchronous_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
TypedProxyTests.4.1.0.cs (2)
26Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_NetTcpBinding_AsyncBeginEnd_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 40Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_NetTcpBinding_AsyncTask_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
CodeStyleConfigFileGenerator (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Consumer (1)
ConsumerWorker.cs (1)
39}, stoppingToken, TaskCreationOptions.LongRunning, TaskScheduler.Current);
Contract.Service.IntegrationTests (8)
ServiceContractTests.4.0.0.cs (4)
336Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Open_ChannelFactory(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 389Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Open_Proxy(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 440Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Close_ChannelFactory(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 490Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Close_Proxy(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
ServiceContractTests.4.1.0.cs (4)
210Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_DefaultSettings_Echo_RoundTrips_String_Streamed(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 224Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_DefaultSettings_Echo_RoundTrips_String_Streamed_Async(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 614Task.Factory.StartNew(() => ServiceContractTests.NetTcp_NoSecurity_Streamed_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 628Task.Factory.StartNew(() => ServiceContractTests.NetTcp_NoSecurity_Streamed_Async_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
dotnet-svcutil-lib (9)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ActionItem.cs (2)
37Task.Factory.StartNew(callback, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 67Task.Factory.StartNew(callback, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (6)
47}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 68}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 92}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 124}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 281return (TaskScheduler.Current == TaskScheduler.Default) &&
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (1)
1183Task.Factory.StartNew(s_receiveThreadSchedulerCallback, result, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
GenerateDocumentationAndConfigFiles (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Kestrel.SampleApp (1)
Startup.cs (1)
69TaskScheduler.UnobservedTaskException += (sender, e) =>
Metrics (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Metrics.Legacy (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.AspNetCore.Components.WebAssembly (2)
Rendering\WebAssemblyDispatcher.cs (2)
112}, TaskScheduler.FromCurrentSynchronizationContext()); 156}, TaskScheduler.FromCurrentSynchronizationContext());
Microsoft.AspNetCore.Components.WebView.Photino (2)
PhotinoSynchronizationContext.cs (1)
240}, CancellationToken.None, flags, TaskScheduler.Current);
PhotinoWebViewManager.cs (1)
43}, message, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingProvider.cs (2)
371TaskScheduler.Default); 413TaskScheduler.Default)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
88_ = Task.Factory.StartNew(RunGarbageCollectionLoopAsync, default, TaskCreationOptions.LongRunning, TaskScheduler.Current);
Microsoft.AspNetCore.Owin (1)
WebSockets\OwinWebSocketAcceptAdapter.cs (1)
129adapter.UpstreamTask.ContinueWith(adapter.EnsureCompleted, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
617TaskScheduler.Default);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Util\EventedStreamReader.cs (1)
30Task.Factory.StartNew(Run, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.AspNetCore.TestHost (1)
HttpContextBuilder.cs (1)
157_ = Task.Factory.StartNew(RunRequestAsync, default, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.Build.Framework (2)
FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis (2)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
676.ContinueWith(c => DiagnosticQueue.TryComplete(), cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
DiagnosticAnalyzer\AsyncQueue.cs (1)
326TaskScheduler.Default);
Microsoft.CodeAnalysis.Analyzers (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.BannedApiAnalyzers (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.CodeStyle (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.Collections.Package (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.Contracts.Package (2)
ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
128await TaskScheduler.Default;
Microsoft.CodeAnalysis.Debugging.Package (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.EditorFeatures (31)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
150await TaskScheduler.Default;
DocumentationComments\CopilotGenerateDocumentationCommentProvider.cs (1)
57await TaskScheduler.Default;
GoOrFind\AbstractGoOrFindNavigationService.cs (3)
150await TaskScheduler.Default; 229await TaskScheduler.Default; 262await TaskScheduler.Default.SwitchTo(alwaysYield: true);
GoToDefinition\GoToDefinitionCommandHandler.cs (1)
120await TaskScheduler.Default;
InlineHints\InlineHintsTag.cs (1)
262await TaskScheduler.Default;
InlineRename\InlineRenameSession.cs (4)
309await TaskScheduler.Default; 539await TaskScheduler.Default; 568await TaskScheduler.Default; 831await TaskScheduler.Default;
IntelliSense\AsyncCompletion\CommitManager.cs (1)
334await TaskScheduler.Default;
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (1)
255await TaskScheduler.Default;
IntelliSense\ModelComputation.cs (2)
141_stopCancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default).Unwrap(); 150await TaskScheduler.Default;
LanguageServer\AlwaysActiveLanguageClientEventListener.cs (1)
79await TaskScheduler.Default.SwitchTo(alwaysYield: true);
NavigationBar\NavigationBarController_ModelComputation.cs (1)
91await TaskScheduler.Default;
Organizing\OrganizeDocumentCommandHandler.cs (1)
139await TaskScheduler.Default;
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
140await TaskScheduler.Default; 164await TaskScheduler.Default;
Shared\Utilities\ThreadingContextTaskSchedulerProvider.cs (2)
20public TaskScheduler CurrentContextScheduler { get; } = threadingContext.HasMainThread 22: TaskScheduler.Default;
Suggestions\SuggestedActions\SuggestedAction.cs (3)
81await TaskScheduler.Default; 89await TaskScheduler.Default; 96await TaskScheduler.Default;
Suggestions\SuggestedActionsSource.cs (4)
135await TaskScheduler.Default; 171await TaskScheduler.Default; 194await TaskScheduler.Default.SwitchTo(alwaysYield: true); 248await TaskScheduler.Default.SwitchTo(alwaysYield: true);
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
337await TaskScheduler.Default;
Workspaces\ITextBufferVisibilityTracker.cs (1)
72CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Threading\TaskJoinExtensions.cs (1)
47TaskScheduler.Default);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (15)
Utilities\AsynchronousOperationListenerTests.cs (15)
68}, _tokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); 93task.Start(TaskScheduler.Default); 120queuedTask.Start(TaskScheduler.Default); 124task.Start(TaskScheduler.Default); 152queuedTask.Start(TaskScheduler.Default); 156task.Start(TaskScheduler.Default); 189task.Start(TaskScheduler.Default); 225secondQueueTask.Start(TaskScheduler.Default); 229firstQueueTask.Start(TaskScheduler.Default); 233task.Start(TaskScheduler.Default); 264cancelledTask.Start(TaskScheduler.Default); 274queuedTask.Start(TaskScheduler.Default); 278task.Start(TaskScheduler.Default); 304}, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 314}, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.Extensions.Package (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
Cohost\RazorStartupServiceFactory.cs (1)
84await TaskScheduler.Default.SwitchTo(alwaysYield: true);
Microsoft.CodeAnalysis.Features (2)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
64TaskScheduler.Default); 354TaskScheduler.Default);
Microsoft.CodeAnalysis.InteractiveHost (17)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\FileWatching\LspFileChangeWatcher.cs (1)
267}, CancellationToken.None, TaskContinuationOptions.OnlyOnRanToCompletion, TaskScheduler.Default).Unwrap().ReportNonFatalErrorAsync().CompletesAsyncOperation(asyncToken);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (2)
47await TaskScheduler.Default; 444await TaskScheduler.Default;
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (2)
178_ = resultTask.ContinueWith(_ => combinedTokenSource.Dispose(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 400}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Utilities\BrokeredServiceProxy.cs (2)
35await TaskScheduler.Default.SwitchTo(alwaysYield: true); 50await TaskScheduler.Default.SwitchTo(alwaysYield: true);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.PooledObjects.Package (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.PublicApiAnalyzers (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\SolutionAssetSource.cs (1)
28await TaskScheduler.Default;
Microsoft.CodeAnalysis.Remote.Workspaces (2)
BrokeredServiceConnection.cs (1)
83await TaskScheduler.Default;
CancellationTokenSourceExtensions.cs (1)
39TaskScheduler.Default);
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Microsoft.CodeAnalysis.Threading.Package (16)
ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.Workspaces (26)
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (2)
34private static readonly TaskScheduler s_exclusiveScheduler = new ConcurrentExclusiveSchedulerPair().ExclusiveScheduler; 57TaskScheduler = _options.Explicit ? TaskScheduler.Default : s_exclusiveScheduler,
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (3)
28private static readonly TaskScheduler s_exclusiveScheduler = new ConcurrentExclusiveSchedulerPair().ExclusiveScheduler; 42private readonly TaskScheduler _scheduler; 54_scheduler = workspace.Kind == WorkspaceKind.RemoteWorkspace ? TaskScheduler.Default : s_exclusiveScheduler;
Shared\TestHooks\AsynchronousOperationListener.cs (1)
87TaskScheduler.Default).Unwrap();
Shared\TestHooks\AsynchronousOperationListenerProvider+NullOperationListener.cs (1)
54TaskScheduler.Default);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (3)
166Contract.ThrowIfFalse(TaskScheduler.Current == this.Storage.Scheduler.ConcurrentScheduler); 225Contract.ThrowIfFalse(TaskScheduler.Current == this.Storage.Scheduler.ExclusiveScheduler); 364Contract.ThrowIfFalse(TaskScheduler.Current == this.Storage.Scheduler.ExclusiveScheduler);
Storage\SQLite\v2\SQLitePersistentStorage_FlushWrites.cs (1)
35Contract.ThrowIfFalse(TaskScheduler.Current == this.Scheduler.ExclusiveScheduler);
Storage\SQLite\v2\SQLitePersistentStorage_StringIds.cs (3)
49TaskScheduler.Current == this.Scheduler.ExclusiveScheduler || 50TaskScheduler.Current == this.Scheduler.ConcurrentScheduler); 67Contract.ThrowIfFalse(TaskScheduler.Current == this.Scheduler.ExclusiveScheduler);
Storage\SQLite\v2\SQLitePersistentStorage_Threading.cs (1)
17TaskScheduler scheduler, CancellationToken cancellationToken) where TArg : struct
Storage\SQLite\v2\SQLitePersistentStorage+PooledConnection.cs (2)
42var scheduler = TaskScheduler.Current;
Workspace\Host\TaskScheduler\ITaskSchedulerProvider.cs (1)
14TaskScheduler CurrentContextScheduler { get; }
Workspace\Host\TaskScheduler\TaskSchedulerProvider.cs (3)
23public TaskScheduler CurrentContextScheduler 24=> (SynchronizationContext.Current != null) ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Default;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
Rpc\RpcServer.cs (1)
87TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
RpcTests.cs (1)
45ServerCompletion = Server.RunAsync().ContinueWith(_ => _serverStream.Dispose(), TaskScheduler.Default);
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (1)
87TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
VisualStudioMSBuildWorkspaceTests.cs (1)
970await Task.Delay(delay).ContinueWith(t => file.Close(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
UtilityTest\AsyncLazyTests.cs (2)
78}, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Current); 98TaskScheduler.Default);
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
RequestExecutionQueue.cs (2)
178_ = resultTask.ContinueWith(_ => combinedTokenSource.Dispose(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 400}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Microsoft.Extensions.Caching.Memory (3)
CacheEntry.CacheEntryTokens.cs (1)
110CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
CacheEntry.cs (1)
288}, obj, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
MemoryCache.cs (1)
398CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\StackGuard.cs (1)
68Task<R> task = Task.Factory.StartNew((Func<object?, R>)action, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalFilesWatcher.cs (1)
465TaskScheduler.Default);
Microsoft.JSInterop (3)
Infrastructure\DotNetDispatcher.cs (3)
118task.ContinueWith(t => EndInvokeDotNetAfterTask(t, jsRuntime, invocationInfo), TaskScheduler.Current); 123valueTaskResult.AsTask().ContinueWith(t => EndInvokeDotNetAfterTask(t, jsRuntime, invocationInfo), TaskScheduler.Current); 131innerTask!.ContinueWith(t => EndInvokeDotNetAfterTask(t, jsRuntime, invocationInfo), TaskScheduler.Current);
Microsoft.Maui.Controls (2)
Internals\AsyncValue.cs (2)
48 TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext();
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
src\Graphics\src\Graphics\Platforms\Windows\AsyncPump.cs (2)
44 { syncCtx.Complete(); }, TaskScheduler.Default); 75 { syncCtx.Complete(); }, TaskScheduler.Default);
Microsoft.Maui.Resizetizer (1)
AsyncTaskExtensions.cs (1)
34 TaskScheduler = TaskScheduler.Default,
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
163var timeoutTask = Task.Delay(timeout).ContinueWith(task => default(Exception), TaskScheduler.Default);
Microsoft.VisualBasic.Tests (4)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (4)
119}, cancellationToken: default, creationOptions: default, scheduler: TaskScheduler.Default)).ToArray(); 157var tasks = Enumerable.Range(0, n).Select(i => Task.Factory.StartNew(() => { Assert.True(SendSecondInstanceArgs(pipeName, SendTimeout, sentArgs[i])); }, cancellationToken: default, creationOptions: default, scheduler: TaskScheduler.Default)).ToArray(); 214var task = Task.Factory.StartNew(() => SendSecondInstanceArgs(pipeName, timeout: 300, []), cancellationToken: TestContext.Current.CancellationToken, creationOptions: default, scheduler: TaskScheduler.Default); 229var task = Task.Factory.StartNew(() => SendSecondInstanceArgs(pipeName, SendTimeout, ["1", "ABC"]), cancellationToken: TestContext.Current.CancellationToken, creationOptions: default, scheduler: TaskScheduler.Default);
Microsoft.VisualStudio.LanguageServices (22)
CodeCleanup\AbstractCodeCleanUpFixer.cs (2)
90await TaskScheduler.Default; 115await TaskScheduler.Default;
DocumentOutline\DocumentOutlineViewModel.cs (2)
265await TaskScheduler.Default; 288await TaskScheduler.Default;
EditorConfigSettings\SettingsEditorPane.SearchTask.cs (1)
43await TaskScheduler.Default;
LanguageService\AbstractPackage`2.cs (2)
71await TaskScheduler.Default; 115await TaskScheduler.Default;
LanguageService\PackageLoadTasks.cs (1)
64await TaskScheduler.Default;
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (1)
523await TaskScheduler.Default;
NavigateTo\RoslynSearchItemsSource.cs (1)
69await TaskScheduler.Default.SwitchTo(alwaysYield: true);
Packaging\PackageInstallerServiceFactory.cs (4)
221await TaskScheduler.Default; 315await TaskScheduler.Default; 387await TaskScheduler.Default; 500await TaskScheduler.Default;
ProjectSystem\FileChangeTracker.cs (1)
138s_lastBackgroundTask = s_lastBackgroundTask.ContinueWith(_ => _fileChangeCookie.GetValueAsync(CancellationToken.None), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Unwrap();
ProjectSystem\FileChangeWatcherProvider.cs (1)
39TaskScheduler.Default)
ProjectSystem\VisualStudioProjectFactory.cs (1)
85await TaskScheduler.Default;
Remote\VisualStudioWorkspaceServiceHubConnector.cs (1)
65TaskScheduler.Default);
RoslynPackage.cs (2)
147await TaskScheduler.Default; 188await TaskScheduler.Default;
Snippets\AbstractSnippetInfoService.cs (1)
123await TaskScheduler.Default;
SymbolSearch\VisualStudioSymbolSearchService.cs (1)
80await TaskScheduler.Default;
Microsoft.VisualStudio.LanguageServices.CSharp (3)
SemanticSearch\SemanticSearchToolWindowController.cs (1)
49await TaskScheduler.Default;
SemanticSearch\SemanticSearchToolWindowImpl.cs (2)
189await TaskScheduler.Default; 400await TaskScheduler.Default;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1168[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskScheduler))]
netstandard (1)
netstandard.cs (1)
2127[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskScheduler))]
OrderProcessor (1)
OrderProcessingWorker.cs (1)
43}, stoppingToken, TaskCreationOptions.LongRunning, TaskScheduler.Current);
Replay (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
Roslyn.Diagnostics.Analyzers (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Roslyn.VisualStudio.DiagnosticsWindow (1)
OptionPages\ForceLowMemoryMode.cs (1)
80return Task.Factory.StartNew(() => this.PopulateAndMonitorWorkerAsync(size), CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default).Unwrap();
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
278t.ContinueWith(delegate { syncCtx.Complete(); }, TaskScheduler.Default);
Security.TransportSecurity.IntegrationTests (2)
Tcp\StreamingTests.4.1.0.cs (2)
385Task.Factory.StartNew(() => StreamingTests.NetTcp_TransportSecurity_Streamed_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 403Task.Factory.StartNew(() => StreamingTests.NetTcp_TransportSecurity_Streamed_Async_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
SemanticSearch.BuildTask (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
133TaskScheduler.Default
System.Data.Odbc (2)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (2)
89}, cancellationTokenSource.Token, TaskContinuationOptions.LongRunning, TaskScheduler.Default)!; 125}, TaskScheduler.Default);
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
686TaskScheduler.Default);
System.Linq.Expressions (1)
System\Linq\Expressions\StackGuard.cs (1)
68Task<R> task = Task.Factory.StartNew(action!, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.Linq.Parallel (25)
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (2)
33private readonly TaskScheduler _taskScheduler; // The task manager to execute the query. 46TaskScheduler taskScheduler, CancellationState cancellationState, int queryId)
System\Linq\Parallel\Merging\MergeExecutor.cs (1)
50PartitionedStream<TInputOutput, TKey> partitions, bool ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, bool isOrdered,
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
28private readonly TaskScheduler _taskScheduler; // The task manager to execute the query. 38internal OrderPreservingMergeHelper(PartitionedStream<TInputOutput, TKey> partitions, TaskScheduler taskScheduler,
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (2)
46private readonly TaskScheduler _taskScheduler; // The task manager to execute the query. 116TaskScheduler taskScheduler,
System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs (2)
24private readonly TaskScheduler _taskScheduler; 44internal PartitionedStreamMerger(bool forEffectMerge, ParallelMergeOptions mergeOptions, TaskScheduler taskScheduler, bool outputOrdered,
System\Linq\Parallel\QueryOperators\QueryOperator.cs (1)
286TaskScheduler? taskScheduler = settings.TaskScheduler;
System\Linq\Parallel\QueryOperators\QuerySettings.cs (5)
27private TaskScheduler? _taskScheduler; 45internal TaskScheduler? TaskScheduler 82internal QuerySettings(TaskScheduler? taskScheduler, int? degreeOfParallelism, 126TaskScheduler? tm = this.TaskScheduler ?? settings2.TaskScheduler; 176settings.TaskScheduler ??= TaskScheduler.Default;
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
151TaskScheduler taskScheduler, bool autoBuffered)
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
72Shared<TInputOutput[]?> results, TaskScheduler taskScheduler)
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
60internal Task RunSynchronously(TaskScheduler taskScheduler) 62Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 79internal Task RunAsynchronously(TaskScheduler taskScheduler) 81Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler.");
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
34SynchronousChannel<TInputOutput>[] channels, TaskScheduler taskScheduler) 90AsynchronousChannel<TInputOutput>[] channels, TaskScheduler taskScheduler) 134QueryTaskGroupState groupState, PartitionedStream<TInputOutput, TIgnoreKey> partitions, TaskScheduler taskScheduler)
System\Linq\Parallel\Utils\PLINQETWProvider.cs (1)
37private static readonly int s_defaultSchedulerId = TaskScheduler.Default.Id;
System.Net.HttpListener (1)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
373TaskScheduler.Default);
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.cs (1)
530}, AsyncOperationManager.CreateOperation(userToken), CancellationToken.None, TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default);
System.Private.CoreLib (305)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (1)
18m_dispatchTask = Task.Factory.StartNew(() => DispatchEventsToEventListeners(sessionID, syncTimeUtc, syncTimeQPC, timeQPCFrequency, previousDispatchTask, m_dispatchTaskCancellationSource.Token), CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default);
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (3)
194cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 567}, readWriteTask, default, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 579readWriteTask.m_taskScheduler = TaskScheduler.Default;
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (4)
223cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 281}, new TupleSlim<TextReader, Memory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default)); 288}, new TupleSlim<TextReader, Memory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default)); 311}, new TupleSlim<TextReader, Memory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default));
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (9)
543}, new TupleSlim<TextWriter, char>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 550}, new TupleSlim<TextWriter, string?>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 589}, new TupleSlim<TextWriter, char[], int, int>(this, buffer, index, count), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 599}, new TupleSlim<TextWriter, ReadOnlyMemory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 606}, new TupleSlim<TextWriter, char>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 613}, new TupleSlim<TextWriter, string?>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 653}, new TupleSlim<TextWriter, char[], int, int>(this, buffer, index, count), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 663}, new TupleSlim<TextWriter, ReadOnlyMemory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 673CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (2)
235currentTaskAtBegin != null ? currentTaskAtBegin.m_taskScheduler!.Id : TaskScheduler.Default.Id, 262currentTaskAtEnd != null ? currentTaskAtEnd.m_taskScheduler!.Id : TaskScheduler.Default.Id,
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (7)
95TaskScheduler scheduler = TaskScheduler.Current; 96if (scheduler == TaskScheduler.Default) 136TaskScheduler scheduler = TaskScheduler.Current; 137if (scheduler == TaskScheduler.Default) 157TplEventSource.Log.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, (currentTask != null) ? currentTask.Id : 0, continuationId);
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (1)
347}, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (9)
37private readonly TaskScheduler m_underlyingTaskScheduler; 73this(TaskScheduler.Default, DefaultMaxConcurrencyLevel, DEFAULT_MAXITEMSPERTASK) 80public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler) : 89public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel) : 100public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) 248public TaskScheduler ConcurrentScheduler => m_concurrentTaskScheduler; 253public TaskScheduler ExclusiveScheduler => m_exclusiveTaskScheduler; 348if (TaskScheduler.Default == m_underlyingTaskScheduler) 707public TaskScheduler TargetScheduler => m_pair.m_underlyingTaskScheduler;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConfigureAwaitOptions.cs (1)
19/// <see cref="TaskScheduler"/> present on the originating thread at the time of the await.
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (36)
285TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) : 301TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) : 309TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 329TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 629return ContinueWith(continuationAction, TaskScheduler.Current, default, TaskContinuationOptions.None); 652return ContinueWith(continuationAction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 664/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 678public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler) 713return ContinueWith(continuationAction, TaskScheduler.Current, default, continuationOptions); 732/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 752TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 758internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken, 810return ContinueWith(continuationAction, state, TaskScheduler.Current, default, TaskContinuationOptions.None); 834return ContinueWith(continuationAction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 847/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 861public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler) 897return ContinueWith(continuationAction, state, TaskScheduler.Current, default, continuationOptions); 917/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 937TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 943internal Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler, CancellationToken cancellationToken, 998return ContinueWith(continuationFunction, TaskScheduler.Current, default, TaskContinuationOptions.None); 1027return ContinueWith(continuationFunction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 1041/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 1055public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler) 1099return ContinueWith(continuationFunction, TaskScheduler.Current, default, continuationOptions); 1121/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1151TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1157internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler, 1212return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, TaskContinuationOptions.None); 1243return ContinueWith(continuationFunction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 1258/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 1273TaskScheduler scheduler) 1319return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, continuationOptions); 1342/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1372CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1379TaskScheduler scheduler, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (41)
34private readonly TaskScheduler? m_defaultScheduler; 38private TaskScheduler DefaultScheduler => m_defaultScheduler ?? TaskScheduler.Current; 41private TaskScheduler GetDefaultScheduler(Task? currTask) 48else return TaskScheduler.Default; 62/// and the <see cref="TaskScheduler">TaskScheduler</see> property is 64/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 82/// and the <see cref="TaskScheduler">TaskScheduler</see> property is 84/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 95/// The <see cref="TaskScheduler"> 105/// and the <see cref="TaskScheduler">TaskScheduler</see> property is 108/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 110public TaskFactory(TaskScheduler? scheduler) // null means to use TaskScheduler.Current 137/// cref="TaskScheduler">TaskScheduler</see> property is initialized to the 139/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 165/// The default <see cref="TaskScheduler"> 180/// cref="TaskScheduler">TaskScheduler</see> property is initialized to 183/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 185public TaskFactory(CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskContinuationOptions continuationOptions, TaskScheduler? scheduler) 206/// Gets the <see cref="TaskScheduler">TaskScheduler</see> of this 212/// If null, <see cref="TaskScheduler.Current">TaskScheduler.Current</see> 215public TaskScheduler? Scheduler => m_defaultScheduler; 329/// cref="TaskScheduler">TaskScheduler</see> 352public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 456/// cref="TaskScheduler">TaskScheduler</see> 479public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 602/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 621TaskScheduler scheduler) 633TaskScheduler scheduler) 1429/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1455CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1565/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1591CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1603TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler) 1650TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler) 1799/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1825CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1935/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1961CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1972TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler) 2023TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (10)
144TaskScheduler ts = TaskScheduler.Current; 145if (ts != TaskScheduler.Default) 244Debug.Assert(context is TaskScheduler or SynchronizationContext, $"context is {context}"); 259Debug.Assert(scheduler is SynchronizationContext or TaskScheduler, $"{nameof(scheduler)} is {scheduler}"); 280context is SynchronizationContext or TaskScheduler or CapturedSchedulerAndExecutionContext, 289case TaskScheduler ts: 301Debug.Assert(cc._scheduler is TaskScheduler, $"{nameof(cc._scheduler)} is {cc._scheduler}"); 302ScheduleTaskScheduler((TaskScheduler)cc._scheduler, continuation, state); 310static void ScheduleTaskScheduler(TaskScheduler scheduler, Action<object?> continuation, object? state) =>
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (72)
128internal TaskScheduler? m_taskScheduler; // The task scheduler this task runs under. 504TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) 536TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) 847internal void FireTaskScheduledIfNeeded(TaskScheduler ts) 903/// cref="TaskScheduler">TaskScheduler</see>. 916Start(TaskScheduler.Current); 921/// cref="TaskScheduler">TaskScheduler</see>. 928/// The <see cref="TaskScheduler">TaskScheduler</see> with which to associate 939public void Start(TaskScheduler scheduler) 977/// cref="TaskScheduler">TaskScheduler</see>. 986/// cref="TaskScheduler">TaskScheduler</see>. 1001InternalRunSynchronously(TaskScheduler.Current, waitForCompletion: true); 1006/// cref="TaskScheduler">scheduler</see> provided. 1027public void RunSynchronously(TaskScheduler scheduler) 1040internal void InternalRunSynchronously(TaskScheduler scheduler, bool waitForCompletion) 1142Task? creatingTask, Delegate action, object? state, CancellationToken cancellationToken, TaskScheduler scheduler, 1453internal TaskScheduler? ExecutingTaskScheduler => m_taskScheduler; 2318log.TaskStarted(TaskScheduler.Current.Id, 0, this.Id); 2372log.TaskCompleted(TaskScheduler.Current.Id, 0, this.Id, IsFaulted); 2511if (TaskScheduler.InternalCurrent is TaskScheduler scheduler && scheduler != TaskScheduler.Default) 2582if (TaskScheduler.InternalCurrent is TaskScheduler scheduler && scheduler != TaskScheduler.Default) 2988currentTask != null ? currentTask.m_taskScheduler!.Id : TaskScheduler.Default.Id, currentTask != null ? currentTask.Id : 0, 3024log.TaskWaitEnd(TaskScheduler.Default.Id, 0, this.Id); 3176TaskScheduler? ts = m_taskScheduler; 3643return ContinueWith(continuationAction, TaskScheduler.Current, default, TaskContinuationOptions.None); 3665return ContinueWith(continuationAction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 3676/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 3690public Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler) 3725return ContinueWith(continuationAction, TaskScheduler.Current, default, continuationOptions); 3744/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 3764TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 3770private Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler, 3821return ContinueWith(continuationAction, state, TaskScheduler.Current, default, TaskContinuationOptions.None); 3844return ContinueWith(continuationAction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 3856/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 3870public Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler) 3906return ContinueWith(continuationAction, state, TaskScheduler.Current, default, continuationOptions); 3926/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 3946TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 3952private Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler, 4006return ContinueWith(continuationFunction, TaskScheduler.Current, default, 4035return ContinueWith(continuationFunction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 4049/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4063public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler) 4101return ContinueWith(continuationFunction, TaskScheduler.Current, default, continuationOptions); 4123/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4146TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4152private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler, 4206return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, 4236return ContinueWith(continuationFunction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 4251/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4265public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler) 4304return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, continuationOptions); 4327/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4350TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4356private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler, 4450TaskScheduler scheduler, 4512log.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, CurrentId ?? 0, continuationTask.Id); 5527return InternalStartNew(null, action, null, default, TaskScheduler.Default, 5545return InternalStartNew(null, action, null, cancellationToken, TaskScheduler.Default, 5560TaskCreationOptions.DenyChildAttach, InternalTaskOptions.None, TaskScheduler.Default); 5578TaskCreationOptions.DenyChildAttach, InternalTaskOptions.None, TaskScheduler.Default); 5617Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 5661Task<Task<TResult>?> task1 = Task<Task<TResult>?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 7187/// A hint to a <see cref="TaskScheduler">TaskScheduler</see> to schedule a 7195/// <see cref="TaskScheduler">TaskScheduler</see> that oversubscription may be 7278/// A hint to a <see cref="TaskScheduler">TaskScheduler</see> to schedule a 7286/// a hint to the <see cref="TaskScheduler">TaskScheduler</see> that
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (13)
266private readonly TaskScheduler m_taskScheduler; 272internal ContinueWithTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler) 407log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId); 456private readonly TaskScheduler m_scheduler; 463TaskScheduler scheduler, Action action, bool flowExecutionContext) : 476if (m_scheduler == TaskScheduler.Default) 489(TaskScheduler.InternalCurrent == m_scheduler || Thread.CurrentThread.IsThreadPoolThread); 547protected Task CreateTask(Action<object?> action, object? state, TaskScheduler scheduler) 580log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId); 615TaskScheduler? sched = TaskScheduler.InternalCurrent; 616return sched == null || sched == TaskScheduler.Default; 818log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, atc.m_continuationId);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (1)
68TaskScheduler.PublishUnobservedTaskException(m_task, ueea);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (50)
38private readonly TaskScheduler? m_defaultScheduler; 42private TaskScheduler DefaultScheduler => m_defaultScheduler ?? TaskScheduler.Current; 45private TaskScheduler GetDefaultScheduler(Task? currTask) 50TaskScheduler.Default); 68/// and the <see cref="TaskScheduler">TaskScheduler</see> property is 70/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 88/// and the <see cref="TaskScheduler">TaskScheduler</see> property is 90/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 101/// The <see cref="TaskScheduler"> 111/// and the <see cref="TaskScheduler">TaskScheduler</see> property is 114/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 116public TaskFactory(TaskScheduler? scheduler) // null means to use TaskScheduler.Current 143/// cref="TaskScheduler">TaskScheduler</see> property is initialized to the 145/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 171/// The default <see cref="TaskScheduler"> 186/// cref="TaskScheduler">TaskScheduler</see> property is initialized to 189/// cref="TaskScheduler.Current">TaskScheduler.Current</see>). 191public TaskFactory(CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskContinuationOptions continuationOptions, TaskScheduler? scheduler) 227/// Gets the <see cref="TaskScheduler">TaskScheduler</see> of this 233/// If null, <see cref="TaskScheduler.Current">TaskScheduler.Current</see> 236public TaskScheduler? Scheduler => m_defaultScheduler; 345/// cref="TaskScheduler">TaskScheduler</see> 368public Task StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 470/// cref="TaskScheduler">TaskScheduler</see> 494TaskCreationOptions creationOptions, TaskScheduler scheduler) 603/// cref="TaskScheduler">TaskScheduler</see> 626public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 743/// cref="TaskScheduler">TaskScheduler</see> 767TaskCreationOptions creationOptions, TaskScheduler scheduler) 834/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 853TaskScheduler scheduler) 1198/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1214IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod, TaskCreationOptions creationOptions, TaskScheduler scheduler) 1779/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1805TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1916/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 1942CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2063/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2089TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2216/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2242CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2495/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2521TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2642/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2668TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2794/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2820CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2931/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2957CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (35)
23/// <see cref="TaskScheduler">TaskScheduler</see> acts as the extension point for all 28/// All members of the abstract <see cref="TaskScheduler"/> type are thread-safe 46/// A class derived from <see cref="TaskScheduler">TaskScheduler</see> 67/// A class derived from <see cref="TaskScheduler">TaskScheduler</see> implements this function to 109/// A class derived from <see cref="TaskScheduler"/> implements this method in order to support 148/// <see cref="TaskScheduler"/> is able to support. 170TaskScheduler? ets = task.ExecutingTaskScheduler; 241private static ConditionalWeakTable<TaskScheduler, object?>? s_activeTaskSchedulers; 244private static readonly TaskScheduler s_defaultTaskScheduler = new ThreadPoolTaskScheduler(); 260/// Initializes the <see cref="TaskScheduler"/>. 279ConditionalWeakTable<TaskScheduler, object?>? activeTaskSchedulers = s_activeTaskSchedulers; 282Interlocked.CompareExchange(ref s_activeTaskSchedulers, new ConditionalWeakTable<TaskScheduler, object?>(), null); 289/// Gets the default <see cref="TaskScheduler">TaskScheduler</see> instance. 291public static TaskScheduler Default => s_defaultTaskScheduler; 294/// Gets the <see cref="TaskScheduler">TaskScheduler</see> 300public static TaskScheduler Current => InternalCurrent ?? Default; 303/// Gets the <see cref="TaskScheduler">TaskScheduler</see> 309internal static TaskScheduler? InternalCurrent 321/// Creates a <see cref="TaskScheduler"/> 331/// A <see cref="TaskScheduler"/> associated with 338public static TaskScheduler FromCurrentSynchronizationContext() 344/// Gets the unique ID for this <see cref="TaskScheduler"/>. 474/// Provides an array of all active <see cref="TaskScheduler">TaskScheduler</see> 481/// <returns>An array of <see cref="TaskScheduler">TaskScheduler</see> instances.</returns> 482internal static TaskScheduler[] GetTaskSchedulersForDebugger() 490List<TaskScheduler> schedulers = new List<TaskScheduler>(); 491foreach (KeyValuePair<TaskScheduler, object?> item in s_activeTaskSchedulers) 503TaskScheduler[] arr = schedulers.ToArray(); 504foreach (TaskScheduler scheduler in arr) 517private readonly TaskScheduler m_taskScheduler; 518public SystemThreadingTasks_TaskSchedulerDebugView(TaskScheduler scheduler) 552/// Implementation of <see cref="TaskScheduler.QueueTask"/> for this scheduler class. 563/// Implementation of <see cref="TaskScheduler.TryExecuteTaskInline"/> for this scheduler class. 588/// Implements the <see cref="TaskScheduler.MaximumConcurrencyLevel"/> property for
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskSchedulerException.cs (1)
20/// <see cref="TaskScheduler"/>.
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (9)
476TaskScheduler? sched = TaskScheduler.InternalCurrent; 477if (sched == null || sched == TaskScheduler.Default) 518Debug.Assert(continuationContext is TaskScheduler { }); 519TaskScheduler sched = (TaskScheduler)continuationContext; 637TaskScheduler? sched = TaskScheduler.InternalCurrent; 638if (sched != null && sched != TaskScheduler.Default)
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
831[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskScheduler))]
System.ServiceModel.Federation (5)
System\Runtime\OperationWithTimeoutAsyncResult.cs (1)
25_ = Task.Factory.StartNew(s_scheduledCallback, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System\Runtime\TaskHelpers.cs (4)
33}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 63}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 87}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 119}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
System.ServiceModel.Primitives.Tests (1)
ServiceModel\ThrowingOnCloseBindingElement.cs (1)
175}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
System.Text.RegularExpressions (11)
System\Threading\StackHelper.cs (11)
40.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 51.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 64.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 79.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 96.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 115.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 123.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 133.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 145.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 159.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 175.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
System.Text.RegularExpressions.Generator (11)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (11)
40.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 51.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 64.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 79.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 96.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 115.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 123.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 133.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 145.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 159.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) 175.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
System.Threading.Channels (8)
System\Threading\Channels\AsyncOperation.cs (8)
244TaskScheduler? ts = 245ctx as TaskScheduler ?? 246(ctx as CapturedSchedulerAndExecutionContext)?._scheduler as TaskScheduler; 248if (RunContinuationsAsynchronously || ts != TaskScheduler.Current) 319TaskScheduler? ts = null; 332ts = TaskScheduler.Current; 333if (ts != TaskScheduler.Default) 400Debug.Assert(scheduler is SynchronizationContext or TaskScheduler, $"{nameof(scheduler)} is {scheduler}");
System.Threading.Tasks (1)
System.Threading.Tasks.cs (1)
34[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskScheduler))]
System.Threading.Tasks.Dataflow (58)
Base\DataflowBlock.cs (13)
513CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 527CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 1296}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 1307}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 1328}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 1839TaskScheduler scheduler = dataflowBlockOptions.TaskScheduler; 1868ISourceBlock<T> source, Action<T> action, int branchId, TaskScheduler scheduler, 1926TaskScheduler scheduler = dataflowBlockOptions.TaskScheduler; 1988}, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 2003TaskScheduler scheduler, 2388TaskScheduler.Default); 2401TaskScheduler.Default); 2402}, this, Canceler.Token, Common.GetContinuationOptions(TaskContinuationOptions.ExecuteSynchronously), TaskScheduler.Default);
Base\DataflowBlockOptions.cs (7)
32/// <description><see cref="System.Threading.Tasks.TaskScheduler.Default"/></description> 69private TaskScheduler _taskScheduler = TaskScheduler.Default; 107/// <summary>Gets or sets the <see cref="System.Threading.Tasks.TaskScheduler"/> to use for scheduling tasks.</summary> 108public TaskScheduler TaskScheduler 214/// <description><see cref="System.Threading.Tasks.TaskScheduler.Default"/></description> 346/// <description><see cref="System.Threading.Tasks.TaskScheduler.Default"/></description>
Blocks\ActionBlock.cs (1)
190}, this, CancellationToken.None, Common.GetContinuationOptions(TaskContinuationOptions.ExecuteSynchronously), TaskScheduler.Default);
Blocks\BatchBlock.cs (4)
75CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 86}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 547}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 655exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\BatchedJoinBlock.cs (2)
104}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 353}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
Blocks\BroadcastBlock.cs (6)
93}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 271exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 404}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 650}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 864}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 947this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\BufferBlock.cs (3)
75}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 272exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 407}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\JoinBlock.cs (5)
86CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 97}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 305CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 316}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 1335}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\TransformBlock.cs (3)
145}, _source, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 156}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 262Common.GetContinuationOptions(TaskContinuationOptions.ExecuteSynchronously), TaskScheduler.Default);
Blocks\TransformManyBlock.cs (2)
144}, source, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 155}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
Blocks\TransformManyBlock.IAsyncEnumerable.cs (1)
40t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Blocks\WriteOnceBlock.cs (1)
142Tuple.Create(this, exceptions), CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Internal\Common.cs (5)
205reg, cancellationToken, Common.GetContinuationOptions(), TaskScheduler.Default); 452internal static Exception? StartTaskSafe(Task task, TaskScheduler scheduler) 457if (scheduler == TaskScheduler.Default) 470private static Exception? StartTaskSafeCore(Task task, TaskScheduler scheduler) 574target, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default);
Internal\SourceCore.cs (3)
523}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 786}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 920this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Internal\TargetCore.cs (2)
390exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 746this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
System.Threading.Tasks.Parallel (36)
System\Threading\Tasks\Parallel.cs (16)
31private TaskScheduler? _scheduler; 47_scheduler = TaskScheduler.Default; 53/// Gets or sets the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 57public TaskScheduler? TaskScheduler 64internal TaskScheduler EffectiveTaskScheduler => _scheduler ?? TaskScheduler.Current; 221ParallelEtwProvider.Log.ParallelInvokeBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 367ParallelEtwProvider.Log.ParallelInvokeEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 973ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 1010ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 1110ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 1155ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID, long.CreateTruncating(nTotalIterations)); 2540ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 2601ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 2747ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 2795ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID, 0);
System\Threading\Tasks\Parallel.ForEachAsync.cs (18)
27return ForAsync(fromInclusive, toExclusive, DefaultDegreeOfParallelism, TaskScheduler.Default, default, body); 45return ForAsync(fromInclusive, toExclusive, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 77private static Task ForAsync<T>(T fromInclusive, T toExclusive, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 203return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 219return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 247private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 358return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 374return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 402private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 520/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 521private readonly TaskScheduler _scheduler; 540protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 547if (scheduler == TaskScheduler.Default) 572if (_scheduler == TaskScheduler.Default) 671Debug.Assert(_scheduler == TaskScheduler.Default, $"Expected {nameof(_scheduler)} == TaskScheduler.Default, got {_scheduler}"); 692int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 714int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 737int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
System\Threading\Tasks\TaskReplicator.cs (2)
18private readonly TaskScheduler _scheduler; 126_scheduler = options.TaskScheduler ?? TaskScheduler.Current;
SystemdTestApp (1)
Startup.cs (1)
41TaskScheduler.UnobservedTaskException += (sender, e) =>
Test.Utilities (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
Text.Analyzers (19)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (2)
234TaskScheduler.Default); 244TaskScheduler.Default);
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (14)
44return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 62return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 87private static TaskScheduler EffectiveTaskScheduler(ParallelOptions options) => options.TaskScheduler ?? TaskScheduler.Current; 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 222return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 240return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 396/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 397private readonly TaskScheduler _scheduler; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 585int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 611int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 638bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
435TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
80channel, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
178TaskScheduler.Default));
UnitTests.Common (1)
TestTypes.cs (1)
346t.ContinueWith(delegate { syncCtx.Complete(); }, TaskScheduler.Default);
VBCSCompiler (1)
src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (1)
111_listenTask.ContinueWith(_ => { }, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)