TaskAwaiter(TResult) Structure
Collapse the table of content
Expand the table of content

TaskAwaiter<TResult> Structure

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Represents an object that waits for the completion of an asynchronous task and provides a parameter for the result.

Namespace:  System.Runtime.CompilerServices
Assembly:  mscorlib (in mscorlib.dll)

public struct TaskAwaiter<TResult> : ICriticalNotifyCompletion, 

Type Parameters


The result for the task.

The TaskAwaiter<TResult> type exposes the following members.

Public propertyIsCompletedGets a value that indicates whether the asynchronous task has completed.

Public methodEqualsIndicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from ValueType.)
Public methodGetResultEnds the wait for the completion of the asynchronous task.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnCompletedSets the action to perform when the TaskAwaiter<TResult> object stops waiting for the asynchronous task to complete.
Public methodToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)
Public methodUnsafeOnCompletedSecurity Critical. Schedules the continuation action for the asynchronous task associated with this awaiter.

This type and its members are intended for use by the compiler.

Windows Phone OS

Supported in: 8.1, 8.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

© 2018 Microsoft