3 types derived from TaskScheduler
mscorlib (3)
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
490private sealed class ConcurrentExclusiveTaskScheduler : TaskScheduler
system\threading\Tasks\TaskScheduler.cs (1)
636internal sealed class SynchronizationContextTaskScheduler : TaskScheduler
system\threading\Tasks\ThreadPoolTaskScheduler.cs (1)
30internal sealed class ThreadPoolTaskScheduler: TaskScheduler
354 references to TaskScheduler
mscorlib (293)
system\io\filestream.cs (1)
2865TaskScheduler.Default);
system\io\stream.cs (3)
286cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 531TaskScheduler.Default); 545readWriteTask.m_taskScheduler = TaskScheduler.Default;
system\io\textreader.cs (2)
200return Task<String>.Factory.StartNew(_ReadLineDelegate, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 240return Task<int>.Factory.StartNew(_ReadDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
system\io\textwriter.cs (7)
544return Task.Factory.StartNew(_WriteCharDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 552return Task.Factory.StartNew(_WriteStringDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 568return Task.Factory.StartNew(_WriteCharArrayRangeDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 576return Task.Factory.StartNew(_WriteLineCharDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 584return Task.Factory.StartNew(_WriteLineStringDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 600return Task.Factory.StartNew(_WriteLineCharArrayRangeDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 614return Task.Factory.StartNew(_FlushDelegate, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
system\runtime\compilerservices\TaskAwaiter.cs (2)
251(currentTaskAtBegin != null ? currentTaskAtBegin.m_taskScheduler.Id : TaskScheduler.Default.Id), 276(currentTaskAtEnd != null ? currentTaskAtEnd.m_taskScheduler.Id : TaskScheduler.Default.Id),
system\runtime\compilerservices\YieldAwaitable.cs (4)
108TaskScheduler scheduler = TaskScheduler.Current; 109if (scheduler == TaskScheduler.Default) 133TplEtwProvider.Log.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, (currentTask != null) ? currentTask.Id : 0, continuationId);
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (9)
46private readonly TaskScheduler m_underlyingTaskScheduler; 80this(TaskScheduler.Default, DefaultMaxConcurrencyLevel, DEFAULT_MAXITEMSPERTASK) { } 86public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler) : 94public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel) : 104public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) 251public TaskScheduler ConcurrentScheduler { get { return m_concurrentTaskScheduler; } } 256public TaskScheduler ExclusiveScheduler { get { return m_exclusiveTaskScheduler; } } 573bool isDefaultScheduler = m_pair.m_underlyingTaskScheduler == TaskScheduler.Default; 713public TaskScheduler TargetScheduler { get { return m_pair.m_underlyingTaskScheduler; } }
system\threading\Tasks\Future.cs (38)
331TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler, 351TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) : 362TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler, ref StackCrawlMark stackMark) : 381TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) : 393TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler, ref StackCrawlMark stackMark) 418TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler, ref StackCrawlMark stackMark) 738return ContinueWith(continuationAction, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark); 766return ContinueWith(continuationAction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 778/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 793public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler) 831return ContinueWith(continuationAction, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 850/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 874TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 881internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken, 938return ContinueWith(continuationAction, state, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark); 967return ContinueWith(continuationAction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 980/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 995public Task ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state, TaskScheduler scheduler) 1034return ContinueWith(continuationAction, state, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 1054/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1078TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1085internal Task ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state, TaskScheduler scheduler, CancellationToken cancellationToken, 1145return ContinueWith<TNewResult>(continuationFunction, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark); 1176return ContinueWith<TNewResult>(continuationFunction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 1190/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 1205public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler) 1252return ContinueWith<TNewResult>(continuationFunction, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 1274/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1305TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1312internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler, 1372return ContinueWith<TNewResult>(continuationFunction, state, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark); 1405return ContinueWith<TNewResult>(continuationFunction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 1420/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 1436TaskScheduler scheduler) 1485return ContinueWith<TNewResult>(continuationFunction, state, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 1508/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 1539CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1547TaskScheduler scheduler, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, ref StackCrawlMark stackMark)
system\threading\Tasks\FutureFactory.cs (39)
53private TaskScheduler m_defaultScheduler; 57private TaskScheduler DefaultScheduler 61if (m_defaultScheduler == null) return TaskScheduler.Current; 67private TaskScheduler GetDefaultScheduler(Task currTask) 74else return TaskScheduler.Default; 88/// and the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is 90/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 109/// and the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is 111/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 122/// The <see cref="System.Threading.Tasks.TaskScheduler"> 132/// and the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is 135/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 137public TaskFactory(TaskScheduler scheduler) // null means to use TaskScheduler.Current 164/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is initialized to the 166/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 188/// The default <see cref="System.Threading.Tasks.TaskScheduler"> 203/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is initialized to 206/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 208public TaskFactory(CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 233/// Gets the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> of this 239/// If null, <see cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see> 242public TaskScheduler Scheduler { get { return m_defaultScheduler; } } 386public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 521public Task<TResult> StartNew(Func<Object, TResult> function, Object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 656/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 676TaskScheduler scheduler) 690TaskScheduler scheduler, 1584/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 1611CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1732/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 1759CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 1773TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler, ref StackCrawlMark stackMark) 1820TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler, ref StackCrawlMark stackMark) 1984/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2011CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2132/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2159CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2172TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler, ref StackCrawlMark stackMark) 2220TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler, ref StackCrawlMark stackMark)
system\threading\Tasks\Parallel.cs (19)
42private TaskScheduler m_scheduler; 58m_scheduler = TaskScheduler.Default; 68public TaskScheduler TaskScheduler 75internal TaskScheduler EffectiveTaskScheduler 79if (m_scheduler == null) return TaskScheduler.Current; 255TplEtwProvider.Log.ParallelInvokeBegin((callerTask != null ? callerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callerTask != null ? callerTask.Id : 0), 408TplEtwProvider.Log.ParallelInvokeEnd((callerTask != null ? callerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callerTask != null ? callerTask.Id : 0), 1101TplEtwProvider.Log.ParallelLoopBegin((callingTask != null ? callingTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callingTask != null ? callingTask.Id : 0), 1153TplEtwProvider.Log.ParallelFork((currentWorkerTask != null ? currentWorkerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (currentWorkerTask != null ? currentWorkerTask.Id : 0), 1256TplEtwProvider.Log.ParallelJoin((currentWorkerTask != null ? currentWorkerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (currentWorkerTask != null ? currentWorkerTask.Id : 0), 1322TplEtwProvider.Log.ParallelLoopEnd((callingTask != null ? callingTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callingTask != null ? callingTask.Id : 0), 1416TplEtwProvider.Log.ParallelLoopBegin((callerTask != null ? callerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callerTask != null ? callerTask.Id : 0), 1466TplEtwProvider.Log.ParallelFork((currentWorkerTask != null ? currentWorkerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (currentWorkerTask != null ? currentWorkerTask.Id : 0), 1569TplEtwProvider.Log.ParallelJoin((currentWorkerTask != null ? currentWorkerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (currentWorkerTask != null ? currentWorkerTask.Id : 0), 1635TplEtwProvider.Log.ParallelLoopEnd((callerTask != null ? callerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callerTask != null ? callerTask.Id : 0), 3230TplEtwProvider.Log.ParallelLoopBegin((callerTask != null ? callerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callerTask != null ? callerTask.Id : 0), 3291TplEtwProvider.Log.ParallelFork((currentWorkerTask != null ? currentWorkerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (currentWorkerTask != null ? currentWorkerTask.Id : 0), 3454TplEtwProvider.Log.ParallelJoin((currentWorkerTask != null ? currentWorkerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (currentWorkerTask != null ? currentWorkerTask.Id : 0), 3536TplEtwProvider.Log.ParallelLoopEnd((callerTask != null ? callerTask.m_taskScheduler.Id : TaskScheduler.Current.Id), (callerTask != null ? callerTask.Id : 0),
system\threading\Tasks\Task.cs (75)
168internal TaskScheduler m_taskScheduler; // The task scheduler this task runs under. 541TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler, ref StackCrawlMark stackMark) 559TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 591TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 975internal bool FireTaskScheduledIfNeeded(TaskScheduler ts) 1035/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see>. 1048Start(TaskScheduler.Current); 1053/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see>. 1060/// The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> with which to associate 1071public void Start(TaskScheduler scheduler) 1109/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see>. 1118/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see>. 1133InternalRunSynchronously(TaskScheduler.Current, waitForCompletion: true); 1138/// cref="System.Threading.Tasks.TaskScheduler">scheduler</see> provided. 1159public void RunSynchronously(TaskScheduler scheduler) 1174internal void InternalRunSynchronously(TaskScheduler scheduler, bool waitForCompletion) 1278Task creatingTask, Delegate action, object state, CancellationToken cancellationToken, TaskScheduler scheduler, 1630internal TaskScheduler ExecutingTaskScheduler 2532internal virtual Task CreateReplicaTask(Action<object> taskReplicaDelegate, Object stateObject, Task parentTask, TaskScheduler taskScheduler, 2789etwLog.TaskStarted(TaskScheduler.Current.Id, 0, this.Id); 2843etwLog.TaskCompleted(TaskScheduler.Current.Id, 0, this.Id, IsFaulted); 2991var scheduler = TaskScheduler.InternalCurrent; 2992if (scheduler != null && scheduler != TaskScheduler.Default) 3233(currentTask != null ? currentTask.m_taskScheduler.Id : TaskScheduler.Default.Id), (currentTask != null ? currentTask.Id : 0), 3275etwLog.TaskWaitEnd(TaskScheduler.Default.Id, 0, this.Id); 3403TaskScheduler ts = m_taskScheduler; 3755return ContinueWith(continuationAction, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark); 3782return ContinueWith(continuationAction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 3793/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 3808public Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler) 3846return ContinueWith(continuationAction, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 3865/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 3889TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 3896private Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler, 3953return ContinueWith(continuationAction, state, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark); 3981return ContinueWith(continuationAction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 3993/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4008public Task ContinueWith(Action<Task, Object> continuationAction, Object state, TaskScheduler scheduler) 4047return ContinueWith(continuationAction, state, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 4067/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4091TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4098private Task ContinueWith(Action<Task, Object> continuationAction, Object state, TaskScheduler scheduler, 4158return ContinueWith<TResult>(continuationFunction, TaskScheduler.Current, default(CancellationToken), 4190return ContinueWith<TResult>(continuationFunction, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 4204/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4219public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler) 4260return ContinueWith<TResult>(continuationFunction, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 4282/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4306TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4313private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler, 4373return ContinueWith<TResult>(continuationFunction, state, TaskScheduler.Current, default(CancellationToken), 4406return ContinueWith<TResult>(continuationFunction, state, TaskScheduler.Current, cancellationToken, TaskContinuationOptions.None, ref stackMark); 4421/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its execution. 4436public Task<TResult> ContinueWith<TResult>(Func<Task, Object, TResult> continuationFunction, Object state, TaskScheduler scheduler) 4478return ContinueWith<TResult>(continuationFunction, state, TaskScheduler.Current, default(CancellationToken), continuationOptions, ref stackMark); 4501/// The <see cref="TaskScheduler"/> to associate with the continuation task and to use for its 4525TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 4532private Task<TResult> ContinueWith<TResult>(Func<Task, Object, TResult> continuationFunction, Object state, TaskScheduler scheduler, 4632TaskScheduler scheduler, 4694etwLog.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, Task.CurrentId ?? 0, continuationTask.Id); 5617return Task.InternalStartNew(null, action, null, default(CancellationToken), TaskScheduler.Default, 5637return Task.InternalStartNew(null, action, null, cancellationToken, TaskScheduler.Default, 5654TaskCreationOptions.DenyChildAttach, InternalTaskOptions.None, TaskScheduler.Default, ref stackMark); 5674TaskCreationOptions.DenyChildAttach, InternalTaskOptions.None, TaskScheduler.Default, ref stackMark); 5721Task<Task> task1 = Task<Task>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 5772Task<Task<TResult>> task1 = Task<Task<TResult>>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 6557TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default); 6586TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default); 6765internal override Task CreateReplicaTask(Action<object> taskReplicaDelegate, Object stateObject, Task parentTask, TaskScheduler taskScheduler, 6786internal ParallelForReplicaTask(Action<object> taskReplicaDelegate, Object stateObject, Task parentTask, TaskScheduler taskScheduler, 6833/// A hint to a <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> to schedule a 6841/// <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> that oversubscription may be 6924/// A hint to a <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> to schedule a 6932/// a hint to the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> that
system\threading\Tasks\TaskContinuation.cs (13)
297private readonly TaskScheduler m_taskScheduler; 303internal StandardTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler) 428etwLog.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId); 484private readonly TaskScheduler m_scheduler; 493TaskScheduler scheduler, Action action, bool flowExecutionContext, ref StackCrawlMark stackMark) : 506if (m_scheduler == TaskScheduler.Default) 519(TaskScheduler.InternalCurrent == m_scheduler || Thread.CurrentThread.IsThreadPoolThread); 588protected Task CreateTask(Action<object> action, object state, TaskScheduler scheduler) 622etwLog.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId); 657var sched = TaskScheduler.InternalCurrent; 658return sched == null || sched == TaskScheduler.Default; 833etwLog.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, atc.m_continuationId);
system\threading\Tasks\TaskExceptionHolder.cs (1)
140TaskScheduler.PublishUnobservedTaskException(m_task, ueea);
system\threading\Tasks\TaskFactory.cs (48)
48private TaskScheduler m_defaultScheduler; 53private TaskScheduler DefaultScheduler 57if (m_defaultScheduler == null) return TaskScheduler.Current; 63private TaskScheduler GetDefaultScheduler(Task currTask) 70else return TaskScheduler.Default; 88/// and the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is 90/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 109/// and the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is 111/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 122/// The <see cref="System.Threading.Tasks.TaskScheduler"> 132/// and the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is 135/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 137public TaskFactory(TaskScheduler scheduler) // null means to use TaskScheduler.Current 164/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is initialized to the 166/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 188/// The default <see cref="System.Threading.Tasks.TaskScheduler"> 203/// cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> property is initialized to 206/// cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see>). 208public TaskFactory(CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 250/// Gets the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> of this 256/// If null, <see cref="System.Threading.Tasks.TaskScheduler.Current">TaskScheduler.Current</see> 259public TaskScheduler Scheduler { get { return m_defaultScheduler; } } 398public Task StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 408internal Task StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler) 541TaskCreationOptions creationOptions, TaskScheduler scheduler) 681public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 830TaskCreationOptions creationOptions, TaskScheduler scheduler) 902/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 922TaskScheduler scheduler) 933TaskScheduler scheduler, 1283/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 1300IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod, TaskCreationOptions creationOptions, TaskScheduler scheduler) 1891/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 1918TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2040/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2067CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2199/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2226TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2364/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2391CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2634/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2661TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2793/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2820TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 2955/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 2982CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) 3104/// <param name="scheduler">The <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 3131CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
system\threading\Tasks\TaskScheduler.cs (32)
36/// <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> acts as the extension point for all 41/// All members of the abstract <see cref="TaskScheduler"/> type are thread-safe 85/// A class derived from <see cref="TaskScheduler">TaskScheduler</see> implements this function to 128/// A class derived from <see cref="TaskScheduler"/> implements this method in order to support 168/// <see cref="TaskScheduler"/> is able to support. 197TaskScheduler ets = task.ExecutingTaskScheduler; 285private static ConditionalWeakTable<TaskScheduler, object> s_activeTaskSchedulers; 288private static readonly TaskScheduler s_defaultTaskScheduler = new ThreadPoolTaskScheduler(); 304/// Initializes the <see cref="System.Threading.Tasks.TaskScheduler"/>. 321ConditionalWeakTable<TaskScheduler, object> activeTaskSchedulers = s_activeTaskSchedulers; 324Interlocked.CompareExchange(ref s_activeTaskSchedulers, new ConditionalWeakTable<TaskScheduler, object>(), null); 331/// Gets the default <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> instance. 333public static TaskScheduler Default 342/// Gets the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 348public static TaskScheduler Current 352TaskScheduler current = InternalCurrent; 353return current ?? TaskScheduler.Default; 358/// Gets the <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 364internal static TaskScheduler InternalCurrent 376/// Creates a <see cref="TaskScheduler"/> 386/// A <see cref="TaskScheduler"/> associated with 393public static TaskScheduler FromCurrentSynchronizationContext() 399/// Gets the unique ID for this <see cref="TaskScheduler"/>. 566/// Provides an array of all active <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> 573/// <returns>An array of <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> instances.</returns> 575internal static TaskScheduler[] GetTaskSchedulersForDebugger() 580return new TaskScheduler[] { s_defaultTaskScheduler }; 583ICollection<TaskScheduler> schedulers = s_activeTaskSchedulers.Keys; 591var arr = new TaskScheduler[schedulers.Count]; 593foreach (var scheduler in arr) 606private readonly TaskScheduler m_taskScheduler; 607public SystemThreadingTasks_TaskSchedulerDebugView(TaskScheduler scheduler)
System.Core (28)
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (2)
37private TaskScheduler m_taskScheduler; // The task manager to execute the query. 50TaskScheduler taskScheduler, CancellationState cancellationState, int queryId)
System\Linq\Parallel\Merging\MergeExecutor.cs (1)
55PartitionedStream<TInputOutput, TKey> partitions, bool ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, bool isOrdered,
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
32private TaskScheduler m_taskScheduler; // The task manager to execute the query. 42internal OrderPreservingMergeHelper(PartitionedStream<TInputOutput, TKey> partitions, TaskScheduler taskScheduler,
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (2)
46private readonly TaskScheduler m_taskScheduler; // The task manager to execute the query. 116TaskScheduler taskScheduler,
System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs (2)
28private TaskScheduler m_taskScheduler; 48internal PartitionedStreamMerger(bool forEffectMerge, ParallelMergeOptions mergeOptions, TaskScheduler taskScheduler, bool outputOrdered,
System\Linq\Parallel\QueryOperators\QueryOperator.cs (1)
280TaskScheduler taskScheduler = settings.TaskScheduler;
System\Linq\Parallel\QueryOperators\QuerySettings.cs (5)
34private TaskScheduler m_taskScheduler; 52internal TaskScheduler TaskScheduler 89internal QuerySettings(TaskScheduler taskScheduler, int? degreeOfParallelism, 133TaskScheduler tm = (this.TaskScheduler == null) ? settings2.TaskScheduler : this.TaskScheduler; 186settings.TaskScheduler = TaskScheduler.Default;
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (3)
28private readonly TaskScheduler m_taskScheduler; // The task manager to execute the query. 66TaskScheduler taskScheduler, 155TaskScheduler taskScheduler, bool autoBuffered)
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
76Shared<TInputOutput[]> results, TaskScheduler taskScheduler)
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
64internal Task RunSynchronously(TaskScheduler taskScheduler) 66Contract.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 82internal Task RunAsynchronously(TaskScheduler taskScheduler) 84Contract.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler.");
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
39SynchronousChannel<TInputOutput>[] channels, TaskScheduler taskScheduler) 92AsynchronousChannel<TInputOutput>[] channels, TaskScheduler taskScheduler) 137QueryTaskGroupState groupState, PartitionedStream<TInputOutput, TIgnoreKey> partitions, TaskScheduler taskScheduler)
System\Linq\Parallel\Utils\PLINQETWProvider.cs (1)
44private static readonly int s_defaultSchedulerId = TaskScheduler.Default.Id;
System\Linq\ParallelEnumerable.cs (1)
303internal static ParallelQuery<TSource> WithTaskScheduler<TSource>(this ParallelQuery<TSource> source, TaskScheduler taskScheduler)
System.Data (30)
fx\src\data\System\Data\ProviderBase\DbConnectionFactory.cs (2)
258}, cancellationTokenSource.Token, TaskContinuationOptions.LongRunning, TaskScheduler.Default); 290}, TaskScheduler.Default);
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (4)
528}, TaskScheduler.Default); 769}, TaskScheduler.Default); 1009}, TaskScheduler.Default).Unwrap(); 1810}, TaskScheduler.Default).Unwrap();
fx\src\data\System\Data\SqlClient\SqlCommand.cs (11)
1302globalCompletion.Task.ContinueWith((t) => callback(t), TaskScheduler.Default); 1795globalCompletion.Task.ContinueWith((t) => callback(t), TaskScheduler.Default); 2188globalCompletion.Task.ContinueWith((t) => callback(t), TaskScheduler.Default); 2284}, TaskScheduler.Default); 2292}, TaskScheduler.Default); 2439}, TaskScheduler.Default); 2454}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); 2503}, TaskScheduler.Default); 2563}, TaskScheduler.Default); 2566}, TaskScheduler.Default).Unwrap(); 2607}, TaskScheduler.Default);
fx\src\data\System\Data\SqlClient\SqlConnection.cs (2)
1438completion.Task.ContinueWith(retry.Retry, TaskScheduler.Default); 2145}, TaskScheduler.Default).Unwrap();
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (3)
4172retryTask.ContinueWith((t) => CompleteRetryable(t, source, timeoutCancellationSource), TaskScheduler.Default); 4616}, TaskScheduler.Default).Unwrap(); 4634task.ContinueWith((t) => CompleteRetryable(t, source, objectToDispose), TaskScheduler.Default);
fx\src\data\System\Data\SqlClient\SqlSequentialStream.cs (2)
127readTask.ContinueWith((t) => callback(t), TaskScheduler.Default); 250}, TaskScheduler.Default);
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (1)
226}, TaskScheduler.Default);
fx\src\data\System\Data\SqlClient\SqlUtil.cs (1)
147}, TaskScheduler.Default
fx\src\data\System\Data\SqlClient\TdsParser.cs (4)
8020}, TaskScheduler.Default); 8554}, TaskScheduler.Default); 8591execFlushTask.ContinueWith(tsk => ExecuteFlushTaskCallback(tsk, stateObj, completion, taskReleaseConnectionLock), TaskScheduler.Default); 9656}, TaskScheduler.Default).Unwrap();
System.ServiceModel (2)
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (2)
276}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default); 309}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
System.Web (1)
Util\SynchronizationHelper.cs (1)
108Task newTask = _lastScheduledTask.ContinueWith(_ => SafeWrapCallback(action), TaskScheduler.Default);