System.Threading.Tasks.Task.RunSynchronously Method

Runs the System.Threading.Tasks.Task synchronously on the System.Threading.Tasks.TaskScheduler provided.

Syntax

public void RunSynchronously (TaskScheduler scheduler)

Parameters

scheduler
The scheduler on which to attempt to run this task inline.

Remarks

A task may only be started and run only once. Any attempts to schedule a task a second time will result in an exception.

If the target scheduler does not support running this task on the current thread, the task will be scheduled for execution on the scheduler, and the current thread will block until the task has completed execution.

Requirements

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