system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (26)
40private readonly ConcurrentDictionary<int, ProcessingMode> m_threadProcessingMapping = new ConcurrentDictionary<int, ProcessingMode>();
127m_exclusiveTaskScheduler = new ConcurrentExclusiveTaskScheduler(this, 1, ProcessingMode.ProcessingExclusiveTask);
128m_concurrentTaskScheduler = new ConcurrentExclusiveTaskScheduler(this, m_maxConcurrencyLevel, ProcessingMode.ProcessingConcurrentTasks);
359m_threadProcessingMapping[Thread.CurrentThread.ManagedThreadId] = ProcessingMode.ProcessingExclusiveTask;
376ProcessingMode currentMode;
378Contract.Assert(currentMode == ProcessingMode.ProcessingExclusiveTask,
408m_threadProcessingMapping[Thread.CurrentThread.ManagedThreadId] = ProcessingMode.ProcessingConcurrentTasks;
436ProcessingMode currentMode;
438Contract.Assert(currentMode == ProcessingMode.ProcessingConcurrentTasks,
499private readonly ProcessingMode m_processingMode;
507internal ConcurrentExclusiveTaskScheduler(ConcurrentExclusiveSchedulerPair pair, int maxConcurrencyLevel, ProcessingMode processingMode)
510Contract.Requires(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask,
513(processingMode == ProcessingMode.ProcessingConcurrentTasks && (maxConcurrencyLevel >= 1 || maxConcurrencyLevel == UNLIMITED_PROCESSING)) ||
514(processingMode == ProcessingMode.ProcessingExclusiveTask && maxConcurrencyLevel == 1),
520m_tasks = (processingMode == ProcessingMode.ProcessingExclusiveTask) ?
590ProcessingMode currentThreadMode;
702public ProcessingMode Mode { get { return m_pair.ModeForDebugger; } }
718private ProcessingMode ModeForDebugger
723if (m_completionState != null && m_completionState.Task.IsCompleted) return ProcessingMode.Completed;
726var mode = ProcessingMode.NotCurrentlyProcessing;
727if (m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL) mode |= ProcessingMode.ProcessingExclusiveTask;
728if (m_processingCount >= 1) mode |= ProcessingMode.ProcessingConcurrentTasks;
729if (CompletionRequested) mode |= ProcessingMode.Completing;