TaskAwaiter TaskAwaiter TaskAwaiter TaskAwaiter Struct

定义

提供等待异步任务完成的对象。 Provides an object that waits for the completion of an asynchronous task.

此 API 支持产品基础结构,不能在代码中直接使用。

public value class TaskAwaiter : System::Runtime::CompilerServices::ICriticalNotifyCompletion
public struct TaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion
type TaskAwaiter = struct
    interface ICriticalNotifyCompletion
    interface INotifyCompletion
Public Structure TaskAwaiter
Implements ICriticalNotifyCompletion
继承
TaskAwaiterTaskAwaiterTaskAwaiterTaskAwaiter
实现

注解

此类型及其成员旨在仅供编译器使用。This type and its members are intended for compiler use only.

属性

IsCompleted IsCompleted IsCompleted IsCompleted

获取一个值,该值指示异步任务是否已完成。 Gets a value that indicates whether the asynchronous task has completed.

方法

GetResult() GetResult() GetResult() GetResult()

结束异步任务完成的等待。 Ends the wait for the completion of the asynchronous task.

OnCompleted(Action) OnCompleted(Action) OnCompleted(Action) OnCompleted(Action)

将操作设置为当 TaskAwaiter 对象停止等待异步任务完成时执行。 Sets the action to perform when the TaskAwaiter object stops waiting for the asynchronous task to complete.

UnsafeOnCompleted(Action) UnsafeOnCompleted(Action) UnsafeOnCompleted(Action) UnsafeOnCompleted(Action)

计划与此 awaiter 相关异步任务的延续操作。 Schedules the continuation action for the asynchronous task that is associated with this awaiter.

适用于