AwaitExtensions.GetAwaiter Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
Gets an awaiter that schedules continuations on the specified SynchronizationContext.
public static Microsoft.VisualStudio.Threading.AwaitExtensions.SynchronizationContextAwaiter GetAwaiter(this System.Threading.SynchronizationContext synchronizationContext);
static member GetAwaiter : System.Threading.SynchronizationContext -> Microsoft.VisualStudio.Threading.AwaitExtensions.SynchronizationContextAwaiter
<Extension()>
Public Function GetAwaiter (synchronizationContext As SynchronizationContext) As AwaitExtensions.SynchronizationContextAwaiter
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 |
Gets an awaiter that schedules continuations on the specified scheduler.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::VisualStudio::Threading::AwaitExtensions::TaskSchedulerAwaiter GetAwaiter(System::Threading::Tasks::TaskScheduler ^ scheduler);
public static Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter GetAwaiter(this System.Threading.Tasks.TaskScheduler scheduler);
static member GetAwaiter : System.Threading.Tasks.TaskScheduler -> Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter
<Extension()>
Public Function GetAwaiter (scheduler As TaskScheduler) As AwaitExtensions.TaskSchedulerAwaiter
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 |
Provides await functionality for ordinary WaitHandles.
public:
[System::Runtime::CompilerServices::Extension]
static System::Runtime::CompilerServices::TaskAwaiter GetAwaiter(System::Threading::WaitHandle ^ handle);
public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter(this System.Threading.WaitHandle handle);
static member GetAwaiter : System.Threading.WaitHandle -> System.Runtime.CompilerServices.TaskAwaiter
<Extension()>
Public Function GetAwaiter (handle As WaitHandle) As TaskAwaiter
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 |