public ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask)
        {
            if (taskScheduler == null)
            {
                throw new ArgumentNullException("taskScheduler");
            }
            if (maxConcurrencyLevel == 0 || maxConcurrencyLevel < -1)
            {
                throw new ArgumentOutOfRangeException("maxConcurrencyLevel");
            }
            if (maxItemsPerTask == 0 || maxItemsPerTask < -1)
            {
                throw new ArgumentOutOfRangeException("maxItemsPerTask");
            }
            this.m_underlyingTaskScheduler = taskScheduler;
            this.m_maxConcurrencyLevel     = maxConcurrencyLevel;
            this.m_maxItemsPerTask         = maxItemsPerTask;
            int concurrencyLevel = taskScheduler.MaximumConcurrencyLevel;

            if (concurrencyLevel > 0 && concurrencyLevel < this.m_maxConcurrencyLevel)
            {
                this.m_maxConcurrencyLevel = concurrencyLevel;
            }
            if (this.m_maxConcurrencyLevel == -1)
            {
                this.m_maxConcurrencyLevel = int.MaxValue;
            }
            if (this.m_maxItemsPerTask == -1)
            {
                this.m_maxItemsPerTask = int.MaxValue;
            }
            this.m_exclusiveTaskScheduler  = new ConcurrentExclusiveSchedulerPair.ConcurrentExclusiveTaskScheduler(this, 1, ConcurrentExclusiveSchedulerPair.ProcessingMode.ProcessingExclusiveTask);
            this.m_concurrentTaskScheduler = new ConcurrentExclusiveSchedulerPair.ConcurrentExclusiveTaskScheduler(this, this.m_maxConcurrencyLevel, ConcurrentExclusiveSchedulerPair.ProcessingMode.ProcessingConcurrentTasks);
        }
 public DebugView(ConcurrentExclusiveSchedulerPair.ConcurrentExclusiveTaskScheduler scheduler)
 {
     this.m_taskScheduler = scheduler;
 }