Stream.CreateWaitHandle Método

Definição

Cuidado

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

Cuidado

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

Aloca um objeto WaitHandle.

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 ();
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
abstract member CreateWaitHandle : unit -> System.Threading.WaitHandle
override this.CreateWaitHandle : unit -> System.Threading.WaitHandle
Protected Overridable Function CreateWaitHandle () As WaitHandle

Retornos

WaitHandle

Uma referência ao WaitHandle alocado.

Atributos

Comentários

Quando chamado pela primeira vez, o método atual cria um WaitHandle objeto e o retorna. Em chamadas CreateWaitHandle subsequentes, retorna uma referência a um novo alça de espera.

Use esse método se você implementar os métodos assíncronos e exigir uma maneira de bloquear ou até que a EndRead EndWrite operação assíncrona seja concluída.

Aplica-se a

Confira também