Table of Contents

Struct AwaitExtensions.TaskSchedulerAwaiter

Namespace
Microsoft.VisualStudio.Threading
Assembly
Microsoft.VisualStudio.Threading.dll

An awaiter returned from GetAwaiter(TaskScheduler).

public readonly struct AwaitExtensions.TaskSchedulerAwaiter : ICriticalNotifyCompletion, INotifyCompletion
Implements
Inherited Members

Constructors

TaskSchedulerAwaiter(TaskScheduler, bool)

Initializes a new instance of the AwaitExtensions.TaskSchedulerAwaiter struct.

public TaskSchedulerAwaiter(TaskScheduler scheduler, bool alwaysYield = false)

Parameters

scheduler TaskScheduler

The scheduler for continuations.

alwaysYield bool

A value indicating whether the caller should yield even if already executing on the desired task scheduler.

Properties

IsCompleted

Gets a value indicating whether no yield is necessary.

public bool IsCompleted { get; }

Property Value

bool

true if the caller is already running on that TaskScheduler.

Methods

GetResult()

Does nothing.

public void GetResult()

OnCompleted(Action)

Schedules a continuation to execute using the specified task scheduler.

public void OnCompleted(Action continuation)

Parameters

continuation Action

The delegate to invoke.

UnsafeOnCompleted(Action)

Schedules a continuation to execute using the specified task scheduler without capturing the ExecutionContext.

public void UnsafeOnCompleted(Action continuation)

Parameters

continuation Action

The action.