Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Threading.​Tasks.​TaskScheduler

Assembly: System.Runtime

Inheritance: object → TaskScheduler

Represents an object that handles the low-level work of queuing tasks onto threads.

Properties

public int
Id
Gets the unique ID for this <see cref="T:System.Threading.Tasks.TaskScheduler" /> .
public int
MaximumConcurrencyLevel
Indicates the maximum concurrency level this <see cref="T:System.Threading.Tasks.TaskScheduler" /> is able to support.

Methods

GetScheduledTasks​()
Returns An enumerable that allows a debugger to traverse the tasks currently queued to this scheduler.
For debugger support only, generates an enumerable of <see cref="T:System.Threading.Tasks.Task" /> instances currently queued to the scheduler waiting to be executed.
protected bool
TryExecuteTask​(Task task)
task A <see cref="T:System.Threading.Tasks.Task" /> object to be executed.
Returns A Boolean that is true if <paramref name="task" /> was successfully executed, false if it was not. A common reason for execution failure is that the task had previously been executed or is in the process of being executed by another thread.
Attempts to execute the provided <see cref="T:System.Threading.Tasks.Task" /> on this scheduler.
protected bool
TryExecuteTaskInline​(Task task, bool taskWasPreviouslyQueued)
task The <see cref="T:System.Threading.Tasks.Task" /> to be executed.
taskWasPreviouslyQueued A Boolean denoting whether or not task has previously been queued. If this parameter is True, then the task may have been previously queued (scheduled); if False, then the task is known not to have been queued, and this call is being made in order to execute the task inline without queuing it.
Returns A Boolean value indicating whether the task was executed inline.
Determines whether the provided <see cref="T:System.Threading.Tasks.Task" /> can be executed synchronously in this call, and if it can, executes it.
public bool
Equals​(object obj)
Inherited from object
obj The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .
public string
ToString​()
Inherited from object
Returns A string that represents the current object.
Returns a string that represents the current object.