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
TaskSchedulerThe scheduler for continuations.
alwaysYield
boolA 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
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
ActionThe 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
ActionThe action.