Stream.CreateWaitHandle 方法

定義

警告

此 API 現已淘汰。

配置 WaitHandle 物件。Allocates a WaitHandle object.

protected:
 virtual System::Threading::WaitHandle ^ CreateWaitHandle();
[System.Obsolete("CreateWaitHandle will be removed eventually.  Please use "new ManualResetEvent(false)" instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle ();
abstract member CreateWaitHandle : unit -> System.Threading.WaitHandle
override this.CreateWaitHandle : unit -> System.Threading.WaitHandle
Protected Overridable Function CreateWaitHandle () As WaitHandle

傳回

所配置 WaitHandle 的參考。A reference to the allocated WaitHandle.

屬性

備註

當第一次呼叫時,目前的方法會建立WaitHandle物件,並將它傳回。When called for the first time, the current method creates a WaitHandle object and returns it. 在後續的呼叫CreateWaitHandle中,會傳回新等候控制碼的參考。On subsequent calls, CreateWaitHandle returns a reference to a new wait handle.

如果您執行非同步方法,而且需要在EndReadEndWrite完成非同步作業之前封鎖的方法,請使用這個方法。Use this method if you implement the asynchronous methods and require a way of blocking in EndRead or EndWrite until the asynchronous operation is complete.

適用於

另請參閱