Stream.CreateWaitHandle Method

Definition

Caution

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

Caution

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

Caution

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

Allocates a WaitHandle object.

C#
[System.Obsolete("CreateWaitHandle will be removed eventually.  Please use "new ManualResetEvent(false)" instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle();
C#
[System.Obsolete("Stream.CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle();
C#
[System.Obsolete("CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle();
C#
protected virtual System.Threading.WaitHandle CreateWaitHandle();

Returns

A reference to the allocated WaitHandle.

Attributes

Remarks

When called for the first time, the current method creates a WaitHandle object and returns it. On subsequent calls, CreateWaitHandle returns a reference to a new wait handle.

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.

Applies to

Product Versions (Obsolete)
.NET (Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9)
.NET Framework 1.1 (2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1)
.NET Standard (2.0, 2.1)

See also