Task.IAsyncResult.AsyncWaitHandle Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a WaitHandle that can be used to wait for the task to complete.

Namespace:   System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

WaitHandle IAsyncResult.AsyncWaitHandle { get; }

Property Value

Type: System.Threading.WaitHandle

A WaitHandle that can be used to wait for the task to complete.

Exception Condition
ObjectDisposedException

The Task has been disposed.

Using the wait functionality provided by Task.Wait is preferable to using AsyncWaitHandle for similar functionality. For more information, see the "Waiting on Tasks" section in Task-based Asynchronous Programming and Using TPL with Other Asynchronous Patterns.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: