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 ();
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.

适用于

另请参阅