AdvUtils.LimitedConcurrencyLevelTaskScheduler.TryExecuteTaskInline C# (CSharp) Метод

TryExecuteTaskInline() защищенный закрытый Метод

Attempts to execute the specified task on the current thread.
protected final TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool
task Task The task to be executed.
taskWasPreviouslyQueued bool
Результат bool
        protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
        {
            // If this thread isn't already processing a task, we don't support inlining
            if (!_currentThreadIsProcessingItems) return false;

            // If the task was previously queued, remove it from the queue
            if (taskWasPreviouslyQueued) TryDequeue(task);

            // Try to run the task.
            return base.TryExecuteTask(task);
        }