Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool.
More...
|
sealed override void | QueueTask (Task task) |
| Queues a task to the scheduler. More...
|
|
sealed override bool | TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued) |
| Attempts to execute the specified task on the current thread. More...
|
|
sealed override bool | TryDequeue (Task task) |
| Attempts to remove a previously scheduled task from the scheduler. More...
|
|
sealed override IEnumerable< Task > | GetScheduledTasks () |
| Gets an enumerable of the tasks currently scheduled on this scheduler. More...
|
|
Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool.
Definition at line 22 of file LimitedConcurrencyLevelTaskScheduler.cs.
System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.LimitedConcurrencyLevelTaskScheduler |
( |
int |
maxDegreeOfParallelism | ) |
|
|
inline |
sealed override IEnumerable<Task> System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.GetScheduledTasks |
( |
| ) |
|
|
inlineprotected |
void System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.NotifyThreadPoolOfPendingWork |
( |
| ) |
|
|
inlineprivate |
sealed override void System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.QueueTask |
( |
Task |
task | ) |
|
|
inlineprotected |
sealed override bool System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.TryDequeue |
( |
Task |
task | ) |
|
|
inlineprotected |
Attempts to remove a previously scheduled task from the scheduler.
- Parameters
-
task | The task to be removed. |
- Returns
- Whether the task could be found and removed.
Definition at line 121 of file LimitedConcurrencyLevelTaskScheduler.cs.
sealed override bool System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.TryExecuteTaskInline |
( |
Task |
task, |
|
|
bool |
taskWasPreviouslyQueued |
|
) |
| |
|
inlineprotected |
Attempts to execute the specified task on the current thread.
- Parameters
-
task | The task to be executed. |
taskWasPreviouslyQueued | |
- Returns
- Whether the task could be executed on the current thread.
Definition at line 106 of file LimitedConcurrencyLevelTaskScheduler.cs.
bool System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler._currentThreadIsProcessingItems |
|
staticprivate |
int System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler._delegatesQueuedOrRunning = 0 |
|
private |
readonly int System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler._maxDegreeOfParallelism |
|
private |
readonly LinkedList<Task> System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler._tasks = new LinkedList<Task>() |
|
private |
sealed override int System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler.MaximumConcurrencyLevel |
|
get |