System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext Method

Creates a System.Threading.Tasks.TaskScheduler associated with the current System.Threading.SynchronizationContext.

Syntax

public static TaskScheduler FromCurrentSynchronizationContext ()

Returns

A System.Threading.Tasks.TaskScheduler associated with the current System.Threading.SynchronizationContext, as determined by System.Threading.SynchronizationContext.Current.

Remarks

All System.Threading.Tasks.Task instances queued to the returned scheduler will be executed through a call to the System.Threading.SynchronizationContext.Post(System.Threading.SendOrPostCallback, object) method on that context.

For more information, see Task Schedulers.

Requirements

Namespace: System.Threading.Tasks
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0