5 types derived from TaskScheduler
Microsoft.Build (2)
AwaitExtensions.cs (1)
153private class OneSTAThreadPerTaskScheduler : TaskScheduler
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1422private sealed class DedicatedThreadsTaskScheduler : 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)
542internal sealed class SynchronizationContextTaskScheduler : TaskScheduler
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
21internal sealed class ThreadPoolTaskScheduler : TaskScheduler
547 references to TaskScheduler
Client.ChannelLayer.IntegrationTests (2)
DuplexChannelWithSynchronizationContext.cs (2)
152Task.Factory.StartNew(() => SingleThreadedSyncContext_CallbackUsingDefaultSyncCtx_SyncCallNotBlocked_Helper(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 217Task.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();
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);
Kestrel.SampleApp (1)
Startup.cs (1)
69TaskScheduler.UnobservedTaskException += (sender, e) =>
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)
603TaskScheduler.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 (7)
AwaitExtensions.cs (2)
27private static TaskScheduler s_staScheduler; 32internal static TaskScheduler OneSTAThreadPerTaskSchedulerInstance
BackEnd\BuildManager\BuildManager.cs (1)
1434TaskScheduler.Default);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
742}, TaskScheduler.Default);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
38private static readonly TaskScheduler s_dedicatedScheduler = new DedicatedThreadsTaskScheduler(); 676TaskScheduler.Default).Unwrap();
Logging\BinaryLogger\ProjectImportsCollector.cs (1)
133TaskScheduler.Default);
Microsoft.Extensions.Caching.Memory (3)
CacheEntry.CacheEntryTokens.cs (1)
110CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
CacheEntry.cs (1)
284}, obj, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
MemoryCache.cs (1)
357CancellationToken.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)
464TaskScheduler.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);
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))]
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
277t.ContinueWith(delegate { syncCtx.Complete(); }, TaskScheduler.Default);
Security.TransportSecurity.IntegrationTests (2)
Tcp\StreamingTests.4.1.0.cs (2)
393Task.Factory.StartNew(() => StreamingTests.NetTcp_TransportSecurity_Streamed_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 412Task.Factory.StartNew(() => StreamingTests.NetTcp_TransportSecurity_Streamed_Async_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
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.Pipes (1)
System\IO\Pipes\NamedPipeClientStream.cs (1)
198}, (this, timeout, cancellationToken, startTime), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
687TaskScheduler.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.Http (8)
System\Net\Http\MessageProcessingHandler.cs (1)
103}, tcs, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
966CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (2)
426}, altSvcBlocklistTimerCt, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 435}, altSvcBlocklistTimerCt, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (2)
159}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 392}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Current);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (2)
185CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 202CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
System.Net.HttpListener (1)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
373TaskScheduler.Default);
System.Net.Mail (1)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
373TaskScheduler.Default);
System.Net.NameResolution (3)
System\Net\Dns.cs (3)
139}, hostNameOrAddress, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 686}, key, cancellationToken, TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default); 698}, key, CancellationToken.None, TaskContinuationOptions.OnlyOnCanceled | TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\UnixIPGlobalProperties.cs (1)
57CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.cs (1)
530}, AsyncOperationManager.CreateOperation(userToken), CancellationToken.None, TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default);
System.Net.Quic (1)
System\Net\Quic\Internal\ResettableValueTaskSource.cs (1)
320}, handle, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
System.Net.Requests (6)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
373TaskScheduler.Default);
System\Net\FileWebRequest.cs (4)
159this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 172}, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 220this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 233}, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System\Net\TaskExtensions.cs (1)
37}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
603TaskScheduler.Default);
System.Private.CoreLib (297)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
139m_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); 575}, readWriteTask, default, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 587readWriteTask.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)
343}, 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)
287TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) : 303TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) : 311TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 331TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 631return ContinueWith(continuationAction, TaskScheduler.Current, default, TaskContinuationOptions.None); 654return ContinueWith(continuationAction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 666/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 680public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler) 715return ContinueWith(continuationAction, TaskScheduler.Current, default, continuationOptions); 734/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 754TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 760internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken, 812return ContinueWith(continuationAction, state, TaskScheduler.Current, default, TaskContinuationOptions.None); 836return ContinueWith(continuationAction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 849/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 863public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler) 899return ContinueWith(continuationAction, state, TaskScheduler.Current, default, continuationOptions); 919/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 939TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 945internal Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler, CancellationToken cancellationToken, 1000return ContinueWith(continuationFunction, TaskScheduler.Current, default, TaskContinuationOptions.None); 1029return ContinueWith(continuationFunction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 1043/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 1057public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler) 1101return ContinueWith(continuationFunction, TaskScheduler.Current, default, continuationOptions); 1123/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1153TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1159internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler, 1214return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, TaskContinuationOptions.None); 1245return ContinueWith(continuationFunction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 1260/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 1275TaskScheduler scheduler) 1321return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, continuationOptions); 1344/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1374CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1381TaskScheduler 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. 506TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) 538TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler? scheduler) 848internal void FireTaskScheduledIfNeeded(TaskScheduler ts) 904/// cref="TaskScheduler">TaskScheduler</see>. 917Start(TaskScheduler.Current); 922/// cref="TaskScheduler">TaskScheduler</see>. 929/// The <see cref="TaskScheduler">TaskScheduler</see> with which to associate 940public void Start(TaskScheduler scheduler) 978/// cref="TaskScheduler">TaskScheduler</see>. 987/// cref="TaskScheduler">TaskScheduler</see>. 1002InternalRunSynchronously(TaskScheduler.Current, waitForCompletion: true); 1007/// cref="TaskScheduler">scheduler</see> provided. 1028public void RunSynchronously(TaskScheduler scheduler) 1041internal 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); 2509if (TaskScheduler.InternalCurrent is TaskScheduler scheduler && scheduler != TaskScheduler.Default) 2580if (TaskScheduler.InternalCurrent is TaskScheduler scheduler && scheduler != TaskScheduler.Default) 2983currentTask != null ? currentTask.m_taskScheduler!.Id : TaskScheduler.Default.Id, currentTask != null ? currentTask.Id : 0, 3019log.TaskWaitEnd(TaskScheduler.Default.Id, 0, this.Id); 3155TaskScheduler? ts = m_taskScheduler; 3622return ContinueWith(continuationAction, TaskScheduler.Current, default, TaskContinuationOptions.None); 3644return ContinueWith(continuationAction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 3655/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 3669public Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler) 3704return ContinueWith(continuationAction, TaskScheduler.Current, default, continuationOptions); 3723/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 3743TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 3749private Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler, 3800return ContinueWith(continuationAction, state, TaskScheduler.Current, default, TaskContinuationOptions.None); 3823return ContinueWith(continuationAction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 3835/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 3849public Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler) 3885return ContinueWith(continuationAction, state, TaskScheduler.Current, default, continuationOptions); 3905/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 3925TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 3931private Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler, 3985return ContinueWith(continuationFunction, TaskScheduler.Current, default, 4014return ContinueWith(continuationFunction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 4028/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4042public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler) 4080return ContinueWith(continuationFunction, TaskScheduler.Current, default, continuationOptions); 4102/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4125TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4131private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler, 4185return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, 4215return ContinueWith(continuationFunction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None); 4230/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4244public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler) 4283return ContinueWith(continuationFunction, state, TaskScheduler.Current, default, continuationOptions); 4306/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4329TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4335private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler, 4429TaskScheduler scheduler, 4491log.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, CurrentId ?? 0, continuationTask.Id); 5481return InternalStartNew(null, action, null, default, TaskScheduler.Default, 5499return InternalStartNew(null, action, null, cancellationToken, TaskScheduler.Default, 5514TaskCreationOptions.DenyChildAttach, InternalTaskOptions.None, TaskScheduler.Default); 5532TaskCreationOptions.DenyChildAttach, InternalTaskOptions.None, TaskScheduler.Default); 5571Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 5615Task<Task<TResult>?> task1 = Task<Task<TResult>?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 7104/// A hint to a <see cref="TaskScheduler">TaskScheduler</see> to schedule a 7112/// <see cref="TaskScheduler">TaskScheduler</see> that oversubscription may be 7195/// A hint to a <see cref="TaskScheduler">TaskScheduler</see> to schedule a 7203/// 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) 2497/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2523TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2644/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2670TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2796/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2822CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2933/// <param name="scheduler">The <see cref="TaskScheduler">TaskScheduler</see> 2959CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (36)
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; 247private static ConditionalWeakTable<TaskScheduler, object?>? s_activeTaskSchedulers; 250private static readonly TaskScheduler s_defaultTaskScheduler = new ThreadPoolTaskScheduler(); 266/// Initializes the <see cref="TaskScheduler"/>. 285ConditionalWeakTable<TaskScheduler, object?>? activeTaskSchedulers = s_activeTaskSchedulers; 288Interlocked.CompareExchange(ref s_activeTaskSchedulers, new ConditionalWeakTable<TaskScheduler, object?>(), null); 295/// Gets the default <see cref="TaskScheduler">TaskScheduler</see> instance. 297public static TaskScheduler Default => s_defaultTaskScheduler; 300/// Gets the <see cref="TaskScheduler">TaskScheduler</see> 306public static TaskScheduler Current => InternalCurrent ?? Default; 309/// Gets the <see cref="TaskScheduler">TaskScheduler</see> 315internal static TaskScheduler? InternalCurrent 327/// Creates a <see cref="TaskScheduler"/> 337/// A <see cref="TaskScheduler"/> associated with 344public static TaskScheduler FromCurrentSynchronizationContext() 350/// Gets the unique ID for this <see cref="TaskScheduler"/>. 480/// Provides an array of all active <see cref="TaskScheduler">TaskScheduler</see> 487/// <returns>An array of <see cref="TaskScheduler">TaskScheduler</see> instances.</returns> 488internal static TaskScheduler[] GetTaskSchedulersForDebugger() 493return new TaskScheduler[] { s_defaultTaskScheduler }; 496List<TaskScheduler> schedulers = new List<TaskScheduler>(); 497foreach (KeyValuePair<TaskScheduler, object?> item in s_activeTaskSchedulers) 509TaskScheduler[] arr = schedulers.ToArray(); 510foreach (TaskScheduler scheduler in arr) 523private readonly TaskScheduler m_taskScheduler; 524public SystemThreadingTasks_TaskSchedulerDebugView(TaskScheduler scheduler) 558/// Implementation of <see cref="TaskScheduler.QueueTask"/> for this scheduler class. 569/// Implementation of <see cref="TaskScheduler.TryExecuteTaskInline"/> for this scheduler class. 594/// Implements the <see cref="TaskScheduler.MaximumConcurrencyLevel"/> property for
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskSchedulerException.cs (1)
20/// <see cref="TaskScheduler"/>.
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net9.0\System.Runtime.Forwards.cs (1)
802[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskScheduler))]
System.ServiceModel.Http (1)
System\ServiceModel\Channels\MessageContent.cs (1)
198}, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.ServiceModel.Primitives (11)
Internals\System\Runtime\IOThreadScheduler.cs (4)
58private static TaskScheduler s_IOTaskScheduler; 88public static TaskScheduler IOTaskScheduler 96s_IOTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); 131Task.Factory.StartNew(callback, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Internals\System\Runtime\TaskHelpers.cs (6)
48}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 78}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 102}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 134}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 442return (TaskScheduler.Current == TaskScheduler.Default) &&
System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (1)
1202Task.Factory.StartNew(s_receiveThreadSchedulerCallback, result, CancellationToken.None, TaskCreationOptions.DenyChildAttach, 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 (7)
System\Threading\Channels\AsyncOperation.cs (7)
68/// <summary>Scheduling context (a <see cref="SynchronizationContext"/> or <see cref="TaskScheduler"/>) to which to queue the continuation. May be null.</summary> 230TaskScheduler? ts = null; 241ts = TaskScheduler.Current; 242if (ts != TaskScheduler.Default) 414TaskScheduler ts = (TaskScheduler)_schedulingContext; 416if (_runContinuationsAsynchronously || ts != TaskScheduler.Current)
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)
537CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 551CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 1329}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 1340}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 1361}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); 1920TaskScheduler scheduler = dataflowBlockOptions.TaskScheduler; 1949ISourceBlock<T> source, Action<T> action, int branchId, TaskScheduler scheduler, 2007TaskScheduler scheduler = dataflowBlockOptions.TaskScheduler; 2067}, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 2082TaskScheduler scheduler, 2473TaskScheduler.Default); 2486TaskScheduler.Default); 2487}, 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)
196}, 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); 550}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 658exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\BatchedJoinBlock.cs (2)
104}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 356}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
Blocks\BroadcastBlock.cs (6)
96}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 277exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 410}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 656}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 870}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 953this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\BufferBlock.cs (3)
78}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 278exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 413}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\JoinBlock.cs (5)
89CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 100}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 314CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 325}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 1350}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\TransformBlock.cs (3)
148}, _source, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default); 159}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default); 265Common.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)
43t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Blocks\WriteOnceBlock.cs (1)
145Tuple.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)
529}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 792}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default); 926this, 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) 227return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 243return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 271private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 382return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, default(CancellationToken), body); 398return ForEachAsync(source, DefaultDegreeOfParallelism, TaskScheduler.Default, cancellationToken, body); 426private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 544/// <summary>The <see cref="TaskScheduler"/> on which all work should be performed.</summary> 545private readonly TaskScheduler _scheduler; 564protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 571if (scheduler == TaskScheduler.Default) 596if (_scheduler == TaskScheduler.Default) 695Debug.Assert(_scheduler == TaskScheduler.Default, $"Expected {nameof(_scheduler)} == TaskScheduler.Default, got {_scheduler}"); 716int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 738int dop, TaskScheduler scheduler, CancellationToken cancellationToken, 761bool needsLock, int 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) =>
UnitTests.Common (1)
TestTypes.cs (1)
346t.ContinueWith(delegate { syncCtx.Complete(); }, TaskScheduler.Default);