[ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
public abstract class WaitHandle
-#if MOONLIGHT
- : IDisposable
-#else
: MarshalByRefObject, IDisposable
-#endif
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern bool WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
Dispose(true);
}
-#if NET_4_0 || MOBILE || MOONLIGHT
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Close ();
}
bool release = false;
try {
if (exitContext) {
-#if MONOTOUCH
- throw new NotSupportedException ("exitContext == true is not supported");
-#else
+#if !MONOTOUCH
SynchronizationAttribute.ExitContext ();
#endif
}
safe_wait_handle.DangerousAddRef (ref release);
return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), millisecondsTimeout, exitContext));
} finally {
+#if !MONOTOUCH
if (exitContext)
SynchronizationAttribute.EnterContext ();
+#endif
if (release)
safe_wait_handle.DangerousRelease ();
}
bool release = false;
try {
if (exitContext) {
-#if MONOTOUCH
- throw new NotSupportedException ("exitContext == true is not supported");
-#else
+#if !MONOTOUCH
SynchronizationAttribute.ExitContext ();
#endif
}
return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), (int) ms, exitContext));
}
finally {
+#if !MONOTOUCH
if (exitContext)
SynchronizationAttribute.EnterContext ();
+#endif
if (release)
safe_wait_handle.DangerousRelease ();
}