// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.Win32.SafeHandles;
using System.Security;
namespace System.Threading
{
public static class WaitHandleExtensions
{
///
/// Gets the native operating system handle.
///
/// The to operate on.
/// A representing the native operating system handle.
[SecurityCritical]
public static SafeWaitHandle GetSafeWaitHandle(this WaitHandle waitHandle)
{
if (waitHandle == null)
{
throw new ArgumentNullException("waitHandle");
}
return waitHandle.SafeWaitHandle;
}
///
/// Sets the native operating system handle
///
/// The to operate on.
/// A representing the native operating system handle.
[SecurityCritical]
public static void SetSafeWaitHandle(this WaitHandle waitHandle, SafeWaitHandle value)
{
if (waitHandle == null)
{
throw new ArgumentNullException("waitHandle");
}
waitHandle.SafeWaitHandle = value;
}
}
}