Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IAsyncResult.AsyncWaitHandle Property

Gets a WaitHandle that is used to wait for an asynchronous operation to complete.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
WaitHandle AsyncWaitHandle { get; }

Property Value

Type: System.Threading.WaitHandle
A wait handle that is used to wait for an asynchronous operation to complete.

The return value allows the client to wait for an asynchronous operation to complete instead of polling IsCompleted until the operation concludes. The return value can be used to perform a WaitOne WaitAny, or WaitAll operation.

The common language runtime supplies a number of waitable objects, such as ManualResetEvent and AutoResetEvent.

Notes to Implementers

The object that implements IAsyncResult does not need to create the WaitHandle until the AsyncWaitHandle property is read. It is the choice of the IAsyncResult implementer. However, if the implementer creates AsyncWaitHandle, it is the responsibility of the implementer to signal the WaitHandle that will terminate the wait at the appropriate time. Once created, AsyncWaitHandle should be kept alive until the user calls the method that concludes the asynchronous operation. At that time the object behind AsyncWaitHandle can be discarded.

Notes to Callers

Clients that wait for the operation to complete (instead of polling) use this property to obtain a synchronization object to wait on.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.