TaskAwaiter<TResult> Structure

July 28, 2014

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, 
	INotifyCompletion

Type Parameters

TResult

The result for the task.

The TaskAwaiter<TResult> type exposes the following members.

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

  NameDescription
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.
Top

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.

Show:
© 2014 Microsoft