Fix non net_4_0 profiles build
[mono.git] / mcs / class / corlib / System.Threading / AsyncFlowControl.cs
index 37f355e73039010dabe23be592b8bc879dd99ccf..498afc2489edf47fc75b7b96dc2b227276756d6f 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Threading.AsyncFlowControl structure
+// System.Threading.AsyncFlowControl.cs
 //
 // Author:
 //     Sebastien Pouliot  <sebastien@ximian.com>
@@ -38,11 +38,7 @@ namespace System.Threading {
                Security
        }
 
-#if NET_2_0
        public struct AsyncFlowControl : IDisposable {
-#else
-       internal struct AsyncFlowControl : IDisposable {
-#endif
                private Thread _t;
                private AsyncFlowControlType _type;
 
@@ -69,7 +65,11 @@ namespace System.Threading {
                        _t = null;
                }
 
-               void IDisposable.Dispose () 
+#if NET_4_0 || MOBILE
+               public void Dispose ()
+#else
+               void IDisposable.Dispose ()
+#endif
                {
                        if (_t != null) {
                                Undo ();
@@ -77,5 +77,39 @@ namespace System.Threading {
                                _type = AsyncFlowControlType.None;
                        }
                }
+
+               public override int GetHashCode ()
+               {
+                       return(base.GetHashCode ());
+               }
+               
+               public override bool Equals (object obj)
+               {
+                       if (!(obj is AsyncFlowControl)) {
+                               return(false);
+                       }
+                       
+                       return(obj.Equals (this));
+               }
+               
+               public bool Equals (AsyncFlowControl obj)
+               {
+                       if (this._t == obj._t &&
+                           this._type == obj._type) {
+                               return(true);
+                       } else {
+                               return(false);
+                       }
+               }
+
+               public static bool operator == (AsyncFlowControl a, AsyncFlowControl b)
+               {
+                       return a.Equals (b);
+               }
+
+               public static bool operator != (AsyncFlowControl a, AsyncFlowControl b)
+               {
+                       return !a.Equals (b);
+               }
        }
 }