Udostępnij za pośrednictwem


Stream.CreateWaitHandle Metoda

Definicja

Przestroga

CreateWaitHandle will be removed eventually. Please use "new ManualResetEvent(false)" instead.

Przestroga

Stream.CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.

Przestroga

CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.

WaitHandle Przydziela obiekt.

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 ();
[System.Obsolete("Stream.CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle ();
[System.Obsolete("CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle ();
protected virtual System.Threading.WaitHandle CreateWaitHandle ();
[<System.Obsolete("CreateWaitHandle will be removed eventually.  Please use "new ManualResetEvent(false)" instead.")>]
abstract member CreateWaitHandle : unit -> System.Threading.WaitHandle
override this.CreateWaitHandle : unit -> System.Threading.WaitHandle
[<System.Obsolete("Stream.CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")>]
abstract member CreateWaitHandle : unit -> System.Threading.WaitHandle
override this.CreateWaitHandle : unit -> System.Threading.WaitHandle
[<System.Obsolete("CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")>]
abstract member CreateWaitHandle : unit -> System.Threading.WaitHandle
override this.CreateWaitHandle : unit -> System.Threading.WaitHandle
abstract member CreateWaitHandle : unit -> System.Threading.WaitHandle
override this.CreateWaitHandle : unit -> System.Threading.WaitHandle
Protected Overridable Function CreateWaitHandle () As WaitHandle

Zwraca

Odwołanie do przydzielonego WaitHandle.

Atrybuty

Uwagi

Po wywołaniu po raz pierwszy bieżąca metoda tworzy WaitHandle obiekt i zwraca go. W kolejnych wywołaniach CreateWaitHandle zwraca odwołanie do nowego uchwytu oczekiwania.

Użyj tej metody, jeśli implementujesz metody asynchroniczne i wymagasz sposobu blokowania w EndRead metodzie lub EndWrite do momentu ukończenia operacji asynchronicznej.

Dotyczy

Zobacz też