using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Contexts;
using Microsoft.Win32.SafeHandles;
namespace System.Threading
{
/// Encapsulates operating system–specific objects that wait for exclusive access to shared resources.
/// 2
// Token: 0x0200062A RID: 1578
[ComVisible(true)]
public abstract class WaitHandle : MarshalByRefObject, IDisposable
{
/// Releases all resources used by the .
// Token: 0x060039E7 RID: 14823 RVA: 0x000C6C2C File Offset: 0x000C4E2C
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
// Token: 0x060039E8 RID: 14824
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
// Token: 0x060039E9 RID: 14825 RVA: 0x000C6C3C File Offset: 0x000C4E3C
private static void CheckArray(WaitHandle[] handles, bool waitAll)
{
if (handles == null)
{
throw new ArgumentNullException("waitHandles");
}
int num = handles.Length;
if (num > 64)
{
throw new NotSupportedException("Too many handles");
}
foreach (WaitHandle waitHandle in handles)
{
if (waitHandle == null)
{
throw new ArgumentNullException("waitHandles", "null handle");
}
if (waitHandle.safe_wait_handle == null)
{
throw new ArgumentException("null element found", "waitHandle");
}
}
}
/// Waits for all the elements in the specified array to receive a signal.
/// true when every element in has received a signal; otherwise the method never returns.
/// A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object.
/// The parameter is null. -or- One or more of the objects in the array are null. -or- is an array with no elements and the .NET Framework version is 2.0 or later.
/// The array contains elements that are duplicates.
/// The number of objects in is greater than the system permits.-or- The attribute is applied to the thread procedure for the current thread, and contains more than one element.
///
/// is an array with no elements and the .NET Framework version is 1.0 or 1.1.
/// The wait terminated because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The array contains a transparent proxy for a in another application domain.
/// 1
// Token: 0x060039EA RID: 14826 RVA: 0x000C6CBC File Offset: 0x000C4EBC
public static bool WaitAll(WaitHandle[] waitHandles)
{
WaitHandle.CheckArray(waitHandles, true);
return WaitHandle.WaitAll_internal(waitHandles, -1, false);
}
/// Waits for all the elements in the specified array to receive a signal, using an value to specify the time interval and specifying whether to exit the synchronization domain before the wait.
/// true when every element in has received a signal; otherwise, false.
/// A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object (duplicates).
/// The number of milliseconds to wait, or (-1) to wait indefinitely.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The parameter is null.-or- One or more of the objects in the array is null. -or- is an array with no elements and the .NET Framework version is 2.0 or later.
/// The array contains elements that are duplicates.
/// The number of objects in is greater than the system permits.-or- The attribute is applied to the thread procedure for the current thread, and contains more than one element.
///
/// is an array with no elements and the .NET Framework version is 1.0 or 1.1.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The array contains a transparent proxy for a in another application domain.
/// 1
// Token: 0x060039EB RID: 14827 RVA: 0x000C6CD0 File Offset: 0x000C4ED0
public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
{
WaitHandle.CheckArray(waitHandles, true);
if (millisecondsTimeout < -1)
{
throw new ArgumentOutOfRangeException("millisecondsTimeout");
}
bool flag;
try
{
if (exitContext)
{
SynchronizationAttribute.ExitContext();
}
flag = WaitHandle.WaitAll_internal(waitHandles, millisecondsTimeout, false);
}
finally
{
if (exitContext)
{
SynchronizationAttribute.EnterContext();
}
}
return flag;
}
/// Waits for all the elements in the specified array to receive a signal, using a value to specify the time interval, and specifying whether to exit the synchronization domain before the wait.
/// true when every element in has received a signal; otherwise false.
/// A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object.
/// A that represents the number of milliseconds to wait, or a that represents -1 milliseconds, to wait indefinitely.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The parameter is null. -or- One or more of the objects in the array is null. -or- is an array with no elements and the .NET Framework version is 2.0 or later.
/// The array contains elements that are duplicates.
/// The number of objects in is greater than the system permits.-or- The attribute is applied to the thread procedure for the current thread, and contains more than one element.
///
/// is an array with no elements and the .NET Framework version is 1.0 or 1.1.
///
/// is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- is greater than .
/// The wait terminated because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The array contains a transparent proxy for a in another application domain.
/// 1
// Token: 0x060039EC RID: 14828 RVA: 0x000C6D40 File Offset: 0x000C4F40
public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext)
{
WaitHandle.CheckArray(waitHandles, true);
long num = (long)timeout.TotalMilliseconds;
if (num < -1L || num > 2147483647L)
{
throw new ArgumentOutOfRangeException("timeout");
}
bool flag;
try
{
if (exitContext)
{
SynchronizationAttribute.ExitContext();
}
flag = WaitHandle.WaitAll_internal(waitHandles, (int)num, exitContext);
}
finally
{
if (exitContext)
{
SynchronizationAttribute.EnterContext();
}
}
return flag;
}
// Token: 0x060039ED RID: 14829
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int WaitAny_internal(WaitHandle[] handles, int ms, bool exitContext);
/// Waits for any of the elements in the specified array to receive a signal.
/// The array index of the object that satisfied the wait.
/// A WaitHandle array containing the objects for which the current instance will wait.
/// The parameter is null.-or-One or more of the objects in the array is null.
/// The number of objects in is greater than the system permits.
///
/// is an array with no elements, and the .NET Framework version is 1.0 or 1.1.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
///
/// is an array with no elements, and the .NET Framework version is 2.0 or later.
/// The array contains a transparent proxy for a in another application domain.
/// 1
// Token: 0x060039EE RID: 14830 RVA: 0x000C6DC4 File Offset: 0x000C4FC4
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int WaitAny(WaitHandle[] waitHandles)
{
WaitHandle.CheckArray(waitHandles, false);
return WaitHandle.WaitAny_internal(waitHandles, -1, false);
}
/// Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval, and specifying whether to exit the synchronization domain before the wait.
/// The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to has passed.
/// A WaitHandle array containing the objects for which the current instance will wait.
/// The number of milliseconds to wait, or (-1) to wait indefinitely.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The parameter is null.-or-One or more of the objects in the array is null.
/// The number of objects in is greater than the system permits.
///
/// is an array with no elements, and the .NET Framework version is 1.0 or 1.1.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
///
/// is an array with no elements, and the .NET Framework version is 2.0 or later.
/// The array contains a transparent proxy for a in another application domain.
/// 1
// Token: 0x060039EF RID: 14831 RVA: 0x000C6DD8 File Offset: 0x000C4FD8
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
{
WaitHandle.CheckArray(waitHandles, false);
if (millisecondsTimeout < -1)
{
throw new ArgumentOutOfRangeException("millisecondsTimeout");
}
int num;
try
{
if (exitContext)
{
SynchronizationAttribute.ExitContext();
}
num = WaitHandle.WaitAny_internal(waitHandles, millisecondsTimeout, exitContext);
}
finally
{
if (exitContext)
{
SynchronizationAttribute.EnterContext();
}
}
return num;
}
/// Waits for any of the elements in the specified array to receive a signal, using a to specify the time interval.
/// The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to has passed.
/// A WaitHandle array containing the objects for which the current instance will wait.
/// A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
/// The parameter is null.-or-One or more of the objects in the array is null.
/// The number of objects in is greater than the system permits.
///
/// is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- is greater than .
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
///
/// is an array with no elements.
/// The array contains a transparent proxy for a in another application domain.
// Token: 0x060039F0 RID: 14832 RVA: 0x000C6E48 File Offset: 0x000C5048
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout)
{
return WaitHandle.WaitAny(waitHandles, timeout, false);
}
/// Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval.
/// The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to has passed.
/// A WaitHandle array containing the objects for which the current instance will wait.
/// The number of milliseconds to wait, or (-1) to wait indefinitely.
/// The parameter is null.-or-One or more of the objects in the array is null.
/// The number of objects in is greater than the system permits.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
///
/// is an array with no elements.
/// The array contains a transparent proxy for a in another application domain.
// Token: 0x060039F1 RID: 14833 RVA: 0x000C6E54 File Offset: 0x000C5054
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout)
{
return WaitHandle.WaitAny(waitHandles, millisecondsTimeout, false);
}
/// Waits for any of the elements in the specified array to receive a signal, using a to specify the time interval and specifying whether to exit the synchronization domain before the wait.
/// The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to has passed.
/// A WaitHandle array containing the objects for which the current instance will wait.
/// A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The parameter is null.-or-One or more of the objects in the array is null.
/// The number of objects in is greater than the system permits.
///
/// is an array with no elements, and the .NET Framework version is 1.0 or 1.1.
///
/// is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- is greater than .
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
///
/// is an array with no elements, and the .NET Framework version is 2.0 or later.
/// The array contains a transparent proxy for a in another application domain.
/// 1
// Token: 0x060039F2 RID: 14834 RVA: 0x000C6E60 File Offset: 0x000C5060
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext)
{
WaitHandle.CheckArray(waitHandles, false);
long num = (long)timeout.TotalMilliseconds;
if (num < -1L || num > 2147483647L)
{
throw new ArgumentOutOfRangeException("timeout");
}
int num2;
try
{
if (exitContext)
{
SynchronizationAttribute.ExitContext();
}
num2 = WaitHandle.WaitAny_internal(waitHandles, (int)num, exitContext);
}
finally
{
if (exitContext)
{
SynchronizationAttribute.EnterContext();
}
}
return num2;
}
/// When overridden in a derived class, releases all resources held by the current .
/// 2
// Token: 0x060039F3 RID: 14835 RVA: 0x000C6EE4 File Offset: 0x000C50E4
public virtual void Close()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// Gets or sets the native operating system handle.
/// An IntPtr representing the native operating system handle. The default is the value of the field.
/// 2
// Token: 0x17000B1D RID: 2845
// (get) Token: 0x060039F4 RID: 14836 RVA: 0x000C6EF4 File Offset: 0x000C50F4
// (set) Token: 0x060039F5 RID: 14837 RVA: 0x000C6F04 File Offset: 0x000C5104
[Obsolete("In the profiles > 2.x, use SafeHandle instead of Handle")]
public virtual IntPtr Handle
{
get
{
return this.safe_wait_handle.DangerousGetHandle();
}
set
{
if (value == WaitHandle.InvalidHandle)
{
this.safe_wait_handle = new SafeWaitHandle(WaitHandle.InvalidHandle, false);
}
else
{
this.safe_wait_handle = new SafeWaitHandle(value, true);
}
}
}
// Token: 0x060039F6 RID: 14838
[MethodImpl(MethodImplOptions.InternalCall)]
private extern bool WaitOne_internal(IntPtr handle, int ms, bool exitContext);
/// When overridden in a derived class, releases the unmanaged resources used by the , and optionally releases the managed resources.
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
// Token: 0x060039F7 RID: 14839 RVA: 0x000C6F3C File Offset: 0x000C513C
protected virtual void Dispose(bool explicitDisposing)
{
if (!this.disposed)
{
this.disposed = true;
if (this.safe_wait_handle == null)
{
return;
}
lock (this)
{
if (this.safe_wait_handle != null)
{
this.safe_wait_handle.Dispose();
}
}
}
}
/// Gets or sets the native operating system handle.
/// A representing the native operating system handle.
// Token: 0x17000B1E RID: 2846
// (get) Token: 0x060039F8 RID: 14840 RVA: 0x000C6FB0 File Offset: 0x000C51B0
// (set) Token: 0x060039F9 RID: 14841 RVA: 0x000C6FB8 File Offset: 0x000C51B8
public SafeWaitHandle SafeWaitHandle
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
get
{
return this.safe_wait_handle;
}
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
set
{
if (value == null)
{
this.safe_wait_handle = new SafeWaitHandle(WaitHandle.InvalidHandle, false);
}
else
{
this.safe_wait_handle = value;
}
}
}
/// Signals one wait handle and waits on another.
/// true if both the signal and the wait complete successfully; if the wait does not complete, the method does not return.
/// The wait handle to signal.
/// The wait handle to wait on.
///
/// is null.-or- is null.
/// The method was called on a thread that has .
/// This method is not supported on Windows 98 or Windows Millennium Edition.
///
/// is a semaphore, and it already has a full count.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// 1
// Token: 0x060039FA RID: 14842 RVA: 0x000C6FE0 File Offset: 0x000C51E0
public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn)
{
return WaitHandle.SignalAndWait(toSignal, toWaitOn, -1, false);
}
/// Signals one wait handle and waits on another, specifying a time-out interval as a 32-bit signed integer and specifying whether to exit the synchronization domain for the context before entering the wait.
/// true if both the signal and the wait completed successfully, or false if the signal completed but the wait timed out.
/// The wait handle to signal.
/// The wait handle to wait on.
/// An integer that represents the interval to wait. If the value is , that is, -1, the wait is infinite.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
///
/// is null.-or- is null.
/// The method is called on a thread that has .
/// This method is not supported on Windows 98 or Windows Millennium Edition.
///
/// is a semaphore, and it already has a full count.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The cannot be signaled because it would exceed its maximum count.
/// 1
// Token: 0x060039FB RID: 14843 RVA: 0x000C6FEC File Offset: 0x000C51EC
public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, int millisecondsTimeout, bool exitContext)
{
if (toSignal == null)
{
throw new ArgumentNullException("toSignal");
}
if (toWaitOn == null)
{
throw new ArgumentNullException("toWaitOn");
}
if (millisecondsTimeout < -1)
{
throw new ArgumentOutOfRangeException("millisecondsTimeout");
}
return WaitHandle.SignalAndWait_Internal(toSignal.Handle, toWaitOn.Handle, millisecondsTimeout, exitContext);
}
/// Signals one wait handle and waits on another, specifying the time-out interval as a and specifying whether to exit the synchronization domain for the context before entering the wait.
/// true if both the signal and the wait completed successfully, or false if the signal completed but the wait timed out.
/// The wait handle to signal.
/// The wait handle to wait on.
/// The interval to wait. If the value is -1, the wait is infinite.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
///
/// is null.-or- is null.
/// The method was called on a thread that has .
/// This method is not supported on Windows 98 or Windows Millennium Edition.
///
/// is a semaphore, and it already has a full count.
///
/// evaluates to a negative number of milliseconds other than -1. -or- is greater than .
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// 1
// Token: 0x060039FC RID: 14844 RVA: 0x000C7040 File Offset: 0x000C5240
public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, TimeSpan timeout, bool exitContext)
{
double totalMilliseconds = timeout.TotalMilliseconds;
if (totalMilliseconds > 2147483647.0)
{
throw new ArgumentOutOfRangeException("timeout");
}
return WaitHandle.SignalAndWait(toSignal, toWaitOn, Convert.ToInt32(totalMilliseconds), false);
}
// Token: 0x060039FD RID: 14845
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool SignalAndWait_Internal(IntPtr toSignal, IntPtr toWaitOn, int ms, bool exitContext);
/// Blocks the current thread until the current wait handle receives a signal.
/// true if the current instance receives a signal. If the current instance is never signaled, never returns.
/// The current instance has already been disposed.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The current instance is a transparent proxy for a in another application domain.
/// 2
// Token: 0x060039FE RID: 14846 RVA: 0x000C7080 File Offset: 0x000C5280
public virtual bool WaitOne()
{
this.CheckDisposed();
bool flag = false;
bool flag2;
try
{
this.safe_wait_handle.DangerousAddRef(ref flag);
flag2 = this.WaitOne_internal(this.safe_wait_handle.DangerousGetHandle(), -1, false);
}
finally
{
if (flag)
{
this.safe_wait_handle.DangerousRelease();
}
}
return flag2;
}
/// Blocks the current thread until the current wait handle receives a signal, using a 32-bit signed integer to specify the time interval and specifying whether to exit the synchronization domain before the wait.
/// true if the current instance receives a signal; otherwise, false.
/// The number of milliseconds to wait, or (-1) to wait indefinitely.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The current instance has already been disposed.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The current instance is a transparent proxy for a in another application domain.
/// 2
// Token: 0x060039FF RID: 14847 RVA: 0x000C70F0 File Offset: 0x000C52F0
public virtual bool WaitOne(int millisecondsTimeout, bool exitContext)
{
this.CheckDisposed();
if (millisecondsTimeout < -1)
{
throw new ArgumentOutOfRangeException("millisecondsTimeout");
}
bool flag = false;
bool flag2;
try
{
if (exitContext)
{
SynchronizationAttribute.ExitContext();
}
this.safe_wait_handle.DangerousAddRef(ref flag);
flag2 = this.WaitOne_internal(this.safe_wait_handle.DangerousGetHandle(), millisecondsTimeout, exitContext);
}
finally
{
if (exitContext)
{
SynchronizationAttribute.EnterContext();
}
if (flag)
{
this.safe_wait_handle.DangerousRelease();
}
}
return flag2;
}
/// Blocks the current thread until the current wait handle receives a signal, using a 32-bit signed integer to specify the time interval.
/// true if the current instance receives a signal; otherwise, false.
/// The number of milliseconds to wait, or (-1) to wait indefinitely.
/// The current instance has already been disposed.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The current instance is a transparent proxy for a in another application domain.
// Token: 0x06003A00 RID: 14848 RVA: 0x000C7188 File Offset: 0x000C5388
public virtual bool WaitOne(int millisecondsTimeout)
{
return this.WaitOne(millisecondsTimeout, false);
}
/// Blocks the current thread until the current instance receives a signal, using a to specify the time interval.
/// true if the current instance receives a signal; otherwise, false.
/// A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
/// The current instance has already been disposed.
///
/// is a negative number other than -1 milliseconds, which represents an infinite time-out.-or- is greater than .
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The current instance is a transparent proxy for a in another application domain.
// Token: 0x06003A01 RID: 14849 RVA: 0x000C7194 File Offset: 0x000C5394
public virtual bool WaitOne(TimeSpan timeout)
{
return this.WaitOne(timeout, false);
}
/// Blocks the current thread until the current instance receives a signal, using a to specify the time interval and specifying whether to exit the synchronization domain before the wait.
/// true if the current instance receives a signal; otherwise, false.
/// A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The current instance has already been disposed.
///
/// is a negative number other than -1 milliseconds, which represents an infinite time-out.-or- is greater than .
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The current instance is a transparent proxy for a in another application domain.
/// 2
// Token: 0x06003A02 RID: 14850 RVA: 0x000C71A0 File Offset: 0x000C53A0
public virtual bool WaitOne(TimeSpan timeout, bool exitContext)
{
this.CheckDisposed();
long num = (long)timeout.TotalMilliseconds;
if (num < -1L || num > 2147483647L)
{
throw new ArgumentOutOfRangeException("timeout");
}
bool flag = false;
bool flag2;
try
{
if (exitContext)
{
SynchronizationAttribute.ExitContext();
}
this.safe_wait_handle.DangerousAddRef(ref flag);
flag2 = this.WaitOne_internal(this.safe_wait_handle.DangerousGetHandle(), (int)num, exitContext);
}
finally
{
if (exitContext)
{
SynchronizationAttribute.EnterContext();
}
if (flag)
{
this.safe_wait_handle.DangerousRelease();
}
}
return flag2;
}
// Token: 0x06003A03 RID: 14851 RVA: 0x000C7250 File Offset: 0x000C5450
internal void CheckDisposed()
{
if (this.disposed || this.safe_wait_handle == null)
{
throw new ObjectDisposedException(base.GetType().FullName);
}
}
/// Waits for all the elements in the specified array to receive a signal, using an value to specify the time interval.
/// true when every element in has received a signal; otherwise, false.
/// A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object (duplicates).
/// The number of milliseconds to wait, or (-1) to wait indefinitely.
/// The parameter is null.-or- One or more of the objects in the array is null. -or- is an array with no elements.
/// The array contains elements that are duplicates.
/// The number of objects in is greater than the system permits.-or- The attribute is applied to the thread procedure for the current thread, and contains more than one element.
///
/// is a negative number other than -1, which represents an infinite time-out.
/// The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The array contains a transparent proxy for a in another application domain.
// Token: 0x06003A04 RID: 14852 RVA: 0x000C727C File Offset: 0x000C547C
public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout)
{
return WaitHandle.WaitAll(waitHandles, millisecondsTimeout, false);
}
/// Waits for all the elements in the specified array to receive a signal, using a value to specify the time interval.
/// true when every element in has received a signal; otherwise, false.
/// A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object.
/// A that represents the number of milliseconds to wait, or a that represents -1 milliseconds, to wait indefinitely.
/// The parameter is null. -or- One or more of the objects in the array is null. -or- is an array with no elements.
/// The array contains elements that are duplicates.
/// The number of objects in is greater than the system permits.-or- The attribute is applied to the thread procedure for the current thread, and contains more than one element.
///
/// is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- is greater than .
/// The wait terminated because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition.
/// The array contains a transparent proxy for a in another application domain.
// Token: 0x06003A05 RID: 14853 RVA: 0x000C7288 File Offset: 0x000C5488
public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout)
{
return WaitHandle.WaitAll(waitHandles, timeout, false);
}
/// Releases the resources held by the current instance.
// Token: 0x06003A06 RID: 14854 RVA: 0x000C7294 File Offset: 0x000C5494
~WaitHandle()
{
this.Dispose(false);
}
/// Indicates that a operation timed out before any of the wait handles were signaled. This field is constant.
/// 1
// Token: 0x0400175E RID: 5982
public const int WaitTimeout = 258;
// Token: 0x0400175F RID: 5983
private SafeWaitHandle safe_wait_handle;
/// Represents an invalid native operating system handle. This field is read-only.
// Token: 0x04001760 RID: 5984
protected static readonly IntPtr InvalidHandle = (IntPtr)(-1);
// Token: 0x04001761 RID: 5985
private bool disposed;
}
}