Task.IAsyncResult.AsyncWaitHandle 屬性

定義

取得 WaitHandle,這個項目可用來等候工作完成。Gets a WaitHandle that can be used to wait for the task to complete.

property System::Threading::WaitHandle ^ System::IAsyncResult::AsyncWaitHandle { System::Threading::WaitHandle ^ get(); };
System.Threading.WaitHandle System.IAsyncResult.AsyncWaitHandle { get; }
System.IAsyncResult.AsyncWaitHandle
 ReadOnly Property AsyncWaitHandle As WaitHandle Implements IAsyncResult.AsyncWaitHandle

屬性值

WaitHandle,可用來等候工作完成。A WaitHandle that can be used to wait for the task to complete.

實作

例外狀況

Task 已經處置。The Task has been disposed.

備註

使用 Task.Wait 所提供的等候功能,最好是針對類似的功能使用 AsyncWaitHandleUsing the wait functionality provided by Task.Wait is preferable to using AsyncWaitHandle for similar functionality. 如需詳細資訊,請參閱以工作為基礎的非同步程式設計使用 TPL 與其他非同步模式中的「等候工作」一節。For more information, see the "Waiting on Tasks" section in Task-based Asynchronous Programming and Using TPL with Other Asynchronous Patterns.

適用於