<PackageReference Include="System.Runtime.Handles" Version="4.0.1-beta-23409" />

WaitHandleExtensions

public static class WaitHandleExtensions
Provides convenience methods to for working with a safe handle for a wait handle.
public static SafeWaitHandle GetSafeWaitHandle(this WaitHandle waitHandle)

Gets the safe handle for a native operating system wait handle.

public static void SetSafeWaitHandle(this WaitHandle waitHandle, SafeWaitHandle value)

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