示例#1
0
        private static void RunWithScheduler(int numThreads, Action <TaskScheduler> action)
        {
            Debug.Assert(numThreads > 1);

            var scheduler = new QueuedTaskScheduler(numThreads);

            action(scheduler);
        }
示例#2
0
 /// <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;
 }
示例#3
0
 /// <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>();
 }