Move NET_4_0 define checks at the right position under the licence text
[mono.git] / mcs / class / corlib / System.Threading / ManualResetEvent.cs
old mode 100755 (executable)
new mode 100644 (file)
index 6ed2025..b914e01
@@ -9,7 +9,7 @@
 //
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 
 using System;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 
 namespace System.Threading 
 {
-
-       public sealed class ManualResetEvent : WaitHandle 
+       [ComVisible (true)]
+       public sealed class ManualResetEvent : EventWaitHandle
        {
                // Constructor
                public ManualResetEvent (bool initialState)
+                       : base(initialState, EventResetMode.ManualReset)
                {
-                       Handle = NativeEventCalls.CreateEvent_internal (true, initialState, null);
                }
 
                // Methods
 
+/* Need BOOTSTRAP_NET_2_0 because System.IO.FileStreamAsyncResult
+ * wants to use the Set method that has moved to EventWaitHandle in
+ * the 2.0 profile
+ */
+#if BOOTSTRAP_NET_2_0
                public bool Set()
                {
                        CheckDisposed ();
@@ -58,6 +64,6 @@ namespace System.Threading
                        CheckDisposed ();
                        return(NativeEventCalls.ResetEvent_internal (Handle));
                }
-
+#endif
        }
 }