WaitHandleExtensions.SetSafeWaitHandle(WaitHandle, SafeWaitHandle) Method

Definition

Sets a safe handle for a native operating system wait handle.

C#
[System.Security.SecurityCritical]
public static void SetSafeWaitHandle(this System.Threading.WaitHandle waitHandle, Microsoft.Win32.SafeHandles.SafeWaitHandle value);
C#
public static void SetSafeWaitHandle(this System.Threading.WaitHandle waitHandle, Microsoft.Win32.SafeHandles.SafeWaitHandle? value);
C#
public static void SetSafeWaitHandle(this System.Threading.WaitHandle waitHandle, Microsoft.Win32.SafeHandles.SafeWaitHandle value);

Parameters

waitHandle
WaitHandle

A wait handle that encapsulates an operating system-specific object that waits for exclusive access to a shared resource.

value
SafeWaitHandle

The safe handle to wrap the operating system handle.

Attributes

Exceptions

waitHandle is null.

Remarks

SetSafeWaitHandle is an extension method that is equivalent to assigning a value to the WaitHandle.SafeWaitHandle property.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0