AwaitExtensions.GetAwaiter Method

Definition

Overloads

GetAwaiter(SynchronizationContext)

Gets an awaiter that schedules continuations on the specified SynchronizationContext.

GetAwaiter(TaskScheduler)

Gets an awaiter that schedules continuations on the specified scheduler.

GetAwaiter(WaitHandle)

Provides await functionality for ordinary WaitHandles.

GetAwaiter(SynchronizationContext)

Gets an awaiter that schedules continuations on the specified SynchronizationContext.

C#
public static Microsoft.VisualStudio.Threading.AwaitExtensions.SynchronizationContextAwaiter GetAwaiter(this System.Threading.SynchronizationContext synchronizationContext);

Parameters

synchronizationContext
SynchronizationContext

The synchronization context used to execute continuations.

Returns

An awaitable.

Remarks

The awaiter that is returned will always result in yielding, even if already executing within the specified synchronizationContext.

Applies to

Visual Studio SDK 2022
Proizvod Verzije
Visual Studio SDK 2022

GetAwaiter(TaskScheduler)

Gets an awaiter that schedules continuations on the specified scheduler.

C#
public static Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter GetAwaiter(this System.Threading.Tasks.TaskScheduler scheduler);

Parameters

scheduler
TaskScheduler

The task scheduler used to execute continuations.

Returns

An awaitable.

Applies to

Visual Studio SDK 2022 i druge verzije
Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022

GetAwaiter(WaitHandle)

Provides await functionality for ordinary WaitHandles.

C#
public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter(this System.Threading.WaitHandle handle);

Parameters

handle
WaitHandle

The handle to wait on.

Returns

The awaiter.

Applies to

Visual Studio SDK 2022 i druge verzije
Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022