Add missing Debugger and ReliabilityContract attributes to .NET 4 types
[mono.git] / mcs / class / corlib / System.Threading / RegisteredWaitHandle.cs
index fe41fef32bfcd47ed71bbf957ca4cf360b0369f8..62e349e648b1060b33c4877794da5cff0cff6efd 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Runtime.InteropServices;
 
 namespace System.Threading
 {
+       [ComVisible (true)]
        public sealed class RegisteredWaitHandle : MarshalByRefObject
        {
                WaitHandle _waitObject;
@@ -86,8 +88,11 @@ namespace System.Threading
 
                private void DoCallBack (object timedOut)
                {
-                       if (_callback != null)
-                               _callback (_state, (bool)timedOut); 
+                       if (_callback != null) {
+                               try {
+                                       _callback (_state, (bool)timedOut); 
+                               } catch {}
+                       }
 
                        lock (this) 
                        {
@@ -97,6 +102,7 @@ namespace System.Threading
                        }
                }
 
+               [ComVisible (true)]
                public bool Unregister(WaitHandle waitObject) 
                {
                        lock (this)