private static void RunWithScheduler(int numThreads, Action <TaskScheduler> action) { Debug.Assert(numThreads > 1); var scheduler = new QueuedTaskScheduler(numThreads); action(scheduler); }
/// <summary>Initializes the debug view.</summary> /// <param name="scheduler">The scheduler.</param> public QueuedTaskSchedulerDebugView(QueuedTaskScheduler scheduler) { if (scheduler == null) { throw new ArgumentNullException("scheduler"); } _scheduler = scheduler; }
/// <summary>Initializes the queue.</summary> /// <param name="priority">The priority associated with this queue.</param> /// <param name="pool">The scheduler with which this queue is associated.</param> internal QueuedTaskSchedulerQueue(int priority, QueuedTaskScheduler pool) { _priority = priority; _pool = pool; _workItems = new Queue <Task>(); }