TaskScheduler.TryDequeue(Task) TaskScheduler.TryDequeue(Task) TaskScheduler.TryDequeue(Task) Method

Definition

Attempts to dequeue a Task that was previously queued to this scheduler.

protected public:
 virtual bool TryDequeue(System::Threading::Tasks::Task ^ task);
[System.Security.SecurityCritical]
protected internal virtual bool TryDequeue (System.Threading.Tasks.Task task);
abstract member TryDequeue : System.Threading.Tasks.Task -> bool
override this.TryDequeue : System.Threading.Tasks.Task -> bool

Parameters

task
Task Task Task

The Task to be dequeued.

Returns

A Boolean denoting whether the task argument was successfully dequeued.

Exceptions

Remarks

For more information, see TaskScheduler.

This method may execute in a finally block; therefore it should return as quickly as possible so that any resources such as CancellationTokenRegistration objects can be disposed of in a timely manner.

Applies to

See also