// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
//
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;
}
}
}