Task.IAsyncResult.AsyncWaitHandle Property

 

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

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

private abstract AsyncWaitHandle : WaitHandle with get
private override AsyncWaitHandle : WaitHandle with 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 Parallelism (Task Parallel Library) 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: