if (length > 64)
throw new NotSupportedException ("Too many handles");
+ if (handles.Length == 0) {
+ // MS throws different exceptions from the different methods.
+ if (waitAll)
+ throw new ArgumentNullException ("waitHandles");
+ else
+ throw new ArgumentException ();
+ }
+
#if false
//
// Although we should thrown an exception if this is an STA thread,
GC.SuppressFinalize (this);
}
+#if NET_4_0
+ public void Dispose ()
+#else
+ void IDisposable.Dispose ()
+#endif
+ {
+ Close ();
+ }
+
public const int WaitTimeout = 258;
//
protected static readonly IntPtr InvalidHandle = (IntPtr) (-1);
bool disposed = false;
- void IDisposable.Dispose() {
- Dispose(true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize(this);
- }
-
~WaitHandle() {
Dispose(false);
}