Author: dick
Date: 2007-05-01 11:28:29 -0400 (Tue, 01 May 2007)
New Revision: 76530

Modified:
   trunk/mcs/class/corlib/System.Threading/AbandonedMutexException.cs
   trunk/mcs/class/corlib/System.Threading/ApartmentState.cs
   trunk/mcs/class/corlib/System.Threading/AsyncFlowControl.cs
   trunk/mcs/class/corlib/System.Threading/AutoResetEvent.cs
   trunk/mcs/class/corlib/System.Threading/ChangeLog
   trunk/mcs/class/corlib/System.Threading/EventResetMode.cs
   trunk/mcs/class/corlib/System.Threading/EventWaitHandle.cs
   trunk/mcs/class/corlib/System.Threading/IOCompletionCallback.cs
   trunk/mcs/class/corlib/System.Threading/Interlocked.cs
   trunk/mcs/class/corlib/System.Threading/LockCookie.cs
   trunk/mcs/class/corlib/System.Threading/ManualResetEvent.cs
   trunk/mcs/class/corlib/System.Threading/Monitor.cs
   trunk/mcs/class/corlib/System.Threading/Mutex.cs
   trunk/mcs/class/corlib/System.Threading/NativeOverlapped.cs
   trunk/mcs/class/corlib/System.Threading/Overlapped.cs
   trunk/mcs/class/corlib/System.Threading/ReaderWriterLock.cs
   trunk/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
   trunk/mcs/class/corlib/System.Threading/SendOrPostCallback.cs
   trunk/mcs/class/corlib/System.Threading/SynchronizationLockException.cs
   trunk/mcs/class/corlib/System.Threading/ThreadAbortException.cs
   trunk/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
   trunk/mcs/class/corlib/System.Threading/ThreadPool.cs
   trunk/mcs/class/corlib/System.Threading/ThreadPriority.cs
   trunk/mcs/class/corlib/System.Threading/ThreadStart.cs
   trunk/mcs/class/corlib/System.Threading/ThreadState.cs
   trunk/mcs/class/corlib/System.Threading/ThreadStateException.cs
   trunk/mcs/class/corlib/System.Threading/TimerCallback.cs
   trunk/mcs/class/corlib/System.Threading/WaitCallback.cs
   trunk/mcs/class/corlib/System.Threading/WaitHandle.cs
   trunk/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs
Log:

2007-05-01  Dick Porter  <[EMAIL PROTECTED]>

        * ThreadState.cs: 
        * AsyncFlowControl.cs: 
        * Interlocked.cs: 
        * RegisteredWaitHandle.cs: 
        * TimerCallback.cs: 
        * ThreadStateException.cs: 
        * Monitor.cs: 
        * ThreadStart.cs: 
        * WaitOrTimerCallback.cs: 
        * LockCookie.cs: 
        * EventWaitHandle.cs: 
        * WaitHandle.cs: 
        * ThreadAbortException.cs: 
        * ThreadPriority.cs: 
        * ReaderWriterLock.cs: 
        * NativeOverlapped.cs: 
        * Mutex.cs: 
        * Overlapped.cs: 
        * ThreadPool.cs: 
        * ApartmentState.cs: 
        * EventResetMode.cs: 
        * SynchronizationLockException.cs: 
        * ManualResetEvent.cs: 
        * WaitCallback.cs: 
        * IOCompletionCallback.cs: 
        * AutoResetEvent.cs: 
        * AbandonedMutexException.cs: 
        * SendOrPostCallback.cs: 
        * ThreadInterruptedException.cs: Update to 2.0 profile




Modified: trunk/mcs/class/corlib/System.Threading/AbandonedMutexException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/AbandonedMutexException.cs  
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/AbandonedMutexException.cs  
2007-05-01 15:28:29 UTC (rev 76530)
@@ -33,10 +33,12 @@
 #if NET_2_0
 
 using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
 
 namespace System.Threading
 {
        [Serializable]
+       [ComVisible (false)]
        public class AbandonedMutexException : SystemException
        {
                Mutex mutex;

Modified: trunk/mcs/class/corlib/System.Threading/ApartmentState.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ApartmentState.cs   2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ApartmentState.cs   2007-05-01 
15:28:29 UTC (rev 76530)
@@ -30,9 +30,16 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+       [Serializable]
+#endif
        public enum ApartmentState {
                STA = 0,
                MTA = 1,

Modified: trunk/mcs/class/corlib/System.Threading/AsyncFlowControl.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/AsyncFlowControl.cs 2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/AsyncFlowControl.cs 2007-05-01 
15:28:29 UTC (rev 76530)
@@ -77,5 +77,29 @@
                                _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);
+                       }
+               }
        }
 }

Modified: trunk/mcs/class/corlib/System.Threading/AutoResetEvent.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/AutoResetEvent.cs   2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/AutoResetEvent.cs   2007-05-01 
15:28:29 UTC (rev 76530)
@@ -34,9 +34,16 @@
 using System;
 using System.Runtime.CompilerServices;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
 namespace System.Threading 
 {
 
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class AutoResetEvent :
 #if NET_2_0
        EventWaitHandle

Modified: trunk/mcs/class/corlib/System.Threading/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ChangeLog   2007-05-01 15:11:29 UTC 
(rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ChangeLog   2007-05-01 15:28:29 UTC 
(rev 76530)
@@ -1,4 +1,35 @@
+2007-05-01  Dick Porter  <[EMAIL PROTECTED]>
 
+       * ThreadState.cs: 
+       * AsyncFlowControl.cs: 
+       * Interlocked.cs: 
+       * RegisteredWaitHandle.cs: 
+       * TimerCallback.cs: 
+       * ThreadStateException.cs: 
+       * Monitor.cs: 
+       * ThreadStart.cs: 
+       * WaitOrTimerCallback.cs: 
+       * LockCookie.cs: 
+       * EventWaitHandle.cs: 
+       * WaitHandle.cs: 
+       * ThreadAbortException.cs: 
+       * ThreadPriority.cs: 
+       * ReaderWriterLock.cs: 
+       * NativeOverlapped.cs: 
+       * Mutex.cs: 
+       * Overlapped.cs: 
+       * ThreadPool.cs: 
+       * ApartmentState.cs: 
+       * EventResetMode.cs: 
+       * SynchronizationLockException.cs: 
+       * ManualResetEvent.cs: 
+       * WaitCallback.cs: 
+       * IOCompletionCallback.cs: 
+       * AutoResetEvent.cs: 
+       * AbandonedMutexException.cs: 
+       * SendOrPostCallback.cs: 
+       * ThreadInterruptedException.cs: Update to 2.0 profile
+
 Thu Apr 19 16:47:52 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
 
        * ThreadPool.cs: patch from Robert Jordan to implement

Modified: trunk/mcs/class/corlib/System.Threading/EventResetMode.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/EventResetMode.cs   2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/EventResetMode.cs   2007-05-01 
15:28:29 UTC (rev 76530)
@@ -31,8 +31,11 @@
 
 #if NET_2_0
 
+using System.Runtime.InteropServices;
+
 namespace System.Threading
 {
+       [ComVisible (false)]
        public enum EventResetMode
        {
                AutoReset = 0,

Modified: trunk/mcs/class/corlib/System.Threading/EventWaitHandle.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/EventWaitHandle.cs  2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/EventWaitHandle.cs  2007-05-01 
15:28:29 UTC (rev 76530)
@@ -31,9 +31,11 @@
 
 using System.Security.AccessControl;
 using System.IO;
+using System.Runtime.InteropServices;
 
 namespace System.Threading
 {
+       [ComVisible (true)]
        public class EventWaitHandle : WaitHandle
        {
                private EventWaitHandle (IntPtr handle)

Modified: trunk/mcs/class/corlib/System.Threading/IOCompletionCallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/IOCompletionCallback.cs     
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/IOCompletionCallback.cs     
2007-05-01 15:28:29 UTC (rev 76530)
@@ -30,12 +30,19 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
        // 'unsafe' wasn't in the spec, but the compiler insists because of
        // the pointer.
+#if NET_2_0
+       [ComVisible (true)]
+#else
        [Serializable]
+#endif
        [CLSCompliant(false)]
        public unsafe delegate void IOCompletionCallback(uint errorCode, uint 
numBytes, NativeOverlapped *pOVERLAP);
 }

Modified: trunk/mcs/class/corlib/System.Threading/Interlocked.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/Interlocked.cs      2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/Interlocked.cs      2007-05-01 
15:28:29 UTC (rev 76530)
@@ -115,6 +115,7 @@
 
                [ComVisible (false)]
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
                public extern static T CompareExchange<T> (ref T location, T 
value, T comparand) where T:class;
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -129,6 +130,7 @@
 
                [ComVisible (false)]
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
                public extern static T Exchange<T> (ref T location1, T value) 
where T:class;
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]

Modified: trunk/mcs/class/corlib/System.Threading/LockCookie.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/LockCookie.cs       2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/LockCookie.cs       2007-05-01 
15:28:29 UTC (rev 76530)
@@ -30,10 +30,17 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#else
        [Serializable]
+#endif
        public struct LockCookie
        {
                internal int ThreadId;
@@ -53,6 +60,34 @@
                        ReaderLocks = reader_locks;
                        WriterLocks = writer_locks;
                }
+
+#if NET_2_0
+               public override int GetHashCode ()
+               {
+                       return(base.GetHashCode ());
+               }
+
+               public bool Equals (LockCookie obj)
+               {
+                       if (this.ThreadId == obj.ThreadId &&
+                           this.ReaderLocks == obj.ReaderLocks &&
+                           this.WriterLocks == obj.WriterLocks) {
+                               return(true);
+                       } else {
+                               return(false);
+                       }
+               }
+               
+               public override bool Equals (Object obj)
+               {
+                       if (!(obj is LockCookie)) {
+                               return(false);
+                       }
+                       
+                       return(obj.Equals (this));
+               }
+#endif
+
        }
 }
 

Modified: trunk/mcs/class/corlib/System.Threading/ManualResetEvent.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ManualResetEvent.cs 2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ManualResetEvent.cs 2007-05-01 
15:28:29 UTC (rev 76530)
@@ -34,9 +34,16 @@
 using System;
 using System.Runtime.CompilerServices;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
 namespace System.Threading 
 {
 
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class ManualResetEvent :
 #if NET_2_0
        EventWaitHandle

Modified: trunk/mcs/class/corlib/System.Threading/Monitor.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/Monitor.cs  2007-05-01 15:11:29 UTC 
(rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/Monitor.cs  2007-05-01 15:28:29 UTC 
(rev 76530)
@@ -35,11 +35,13 @@
 
 #if NET_2_0
 using System.Runtime.ConstrainedExecution;
+using System.Runtime.InteropServices;
 #endif
 
 namespace System.Threading
 {
 #if NET_2_0
+       [ComVisible (true)]
        public static class Monitor
        {
 #else

Modified: trunk/mcs/class/corlib/System.Threading/Mutex.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/Mutex.cs    2007-05-01 15:11:29 UTC 
(rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/Mutex.cs    2007-05-01 15:28:29 UTC 
(rev 76530)
@@ -35,10 +35,14 @@
 using System.Runtime.ConstrainedExecution;
 using System.Security.AccessControl;
 using System.IO;
+using System.Runtime.InteropServices;
 #endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class Mutex : WaitHandle 
        {
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -106,6 +110,11 @@
                        Handle = CreateMutex_internal (initiallyOwned, name, 
out createdNew);
                }
 
+               public MutexSecurity GetAccessControl ()
+               {
+                       throw new NotImplementedException ();
+               }
+
                public static Mutex OpenExisting (string name)
                {
                        return(OpenExisting (name, MutexRights.Synchronize |
@@ -149,5 +158,12 @@
                                throw new ApplicationException ("Mutex is not 
owned");
                        }
                }
+
+#if NET_2_0
+               public void SetAccessControl (MutexSecurity mutexSecurity)
+               {
+                       throw new NotImplementedException ();
+               }
+#endif
        }
 }

Modified: trunk/mcs/class/corlib/System.Threading/NativeOverlapped.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/NativeOverlapped.cs 2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/NativeOverlapped.cs 2007-05-01 
15:28:29 UTC (rev 76530)
@@ -34,10 +34,19 @@
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public struct NativeOverlapped {
+#if NET_2_0
+               public IntPtr EventHandle;
+               public IntPtr InternalHigh;
+               public IntPtr InternalLow;
+#else
                public int EventHandle;
                public int InternalHigh;
                public int InternalLow;
+#endif
                public int OffsetHigh;
                public int OffsetLow;
 

Modified: trunk/mcs/class/corlib/System.Threading/Overlapped.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/Overlapped.cs       2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/Overlapped.cs       2007-05-01 
15:28:29 UTC (rev 76530)
@@ -37,6 +37,9 @@
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public class Overlapped
        {
                IAsyncResult ares;
@@ -44,10 +47,17 @@
                int offsetH;
                int evt;
 
+#if NET_2_0
+               IntPtr evt_ptr;
+#endif
+
                public Overlapped ()
                {
                }
 
+#if NET_2_0
+               [Obsolete ("Not 64bit compatible.  Please use the constructor 
that takes IntPtr for the event handle", false)]
+#endif
                public Overlapped(int offsetLo, int offsetHi, int hEvent, 
IAsyncResult ar)
                {
                        offsetL = offsetLo;
@@ -56,6 +66,17 @@
                        ares = ar;
                }
 
+#if NET_2_0
+               public Overlapped (int offsetLo, int offsetHi, IntPtr hEvent,
+                                  IAsyncResult ar)
+               {
+                       offsetL = offsetLo;
+                       offsetH = offsetHi;
+                       evt_ptr = hEvent;
+                       ares = ar;
+               }
+#endif
+
                [CLSCompliant(false)]
                unsafe public static void Free (NativeOverlapped 
*nativeOverlappedPtr)
                {
@@ -74,22 +95,50 @@
                        Overlapped result = new Overlapped ();
                        result.offsetL = nativeOverlappedPtr->OffsetLow;
                        result.offsetH = nativeOverlappedPtr->OffsetHigh;
+#if NET_2_0
+                       result.evt = (int)nativeOverlappedPtr->EventHandle;
+#else
                        result.evt = nativeOverlappedPtr->EventHandle;
+#endif
                        return result;
                }
 
                [CLSCompliant(false)]
+#if NET_2_0
+               [Obsolete ("Use Pack(iocb, userData) instead", false)]
+#endif
                [MonoTODO ("Security - we need to propagate the call stack")]
                unsafe public NativeOverlapped *Pack (IOCompletionCallback iocb)
                {
                        NativeOverlapped *result = (NativeOverlapped *) 
Marshal.AllocHGlobal (Marshal.SizeOf (typeof (NativeOverlapped)));
                        result->OffsetLow = offsetL;
                        result->OffsetHigh = offsetH;
+#if NET_2_0
+                       result->EventHandle = (IntPtr)evt;
+#else
                        result->EventHandle = evt;
+#endif
                        return result;
                }
+
+#if NET_2_0
+               [CLSCompliant (false)]
+               [ComVisible (false)]
+               [MonoTODO ("handle userData")]
+               unsafe public NativeOverlapped *Pack (IOCompletionCallback 
iocb, object userData)
+               {
+                       NativeOverlapped *result = (NativeOverlapped *) 
Marshal.AllocHGlobal (Marshal.SizeOf(typeof(NativeOverlapped)));
+                       result->OffsetLow = offsetL;
+                       result->OffsetHigh = offsetH;
+                       result->EventHandle = evt_ptr;
+                       return(result);
+               }
+#endif
                
                [CLSCompliant(false)]
+#if NET_2_0
+               [Obsolete ("Use UnsafePack(iocb, userData) instead", false)]
+#endif
                [SecurityPermission (SecurityAction.Demand, 
ControlEvidence=true, ControlPolicy=true)]
                unsafe public NativeOverlapped *UnsafePack 
(IOCompletionCallback iocb)
                {
@@ -97,16 +146,41 @@
                        return Pack (iocb);
                }
 
+#if NET_2_0
+               [ComVisible (false)]
+               [CLSCompliant (false)]
+               unsafe public NativeOverlapped *UnsafePack 
(IOCompletionCallback iocb, object userData)
+               {
+                       return Pack (iocb, userData);
+               }
+#endif
+
                public IAsyncResult AsyncResult {
                        get { return ares; }
                        set { ares = value; }
                }
 
+#if NET_2_0
+               [Obsolete ("Not 64bit compatible.  Use EventHandleIntPtr 
instead.", false)]
+#endif
                public int EventHandle {
                        get { return evt; }
                        set { evt = value; }
                }
 
+#if NET_2_0
+               [ComVisible (false)]
+               public IntPtr EventHandleIntPtr 
+               {
+                       get{
+                               return(evt_ptr);
+                       }
+                       set{
+                               evt_ptr = value;
+                       }
+               }
+#endif
+
                public int OffsetHigh {
                        get { return offsetH; }
                        set { offsetH = value; }

Modified: trunk/mcs/class/corlib/System.Threading/ReaderWriterLock.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ReaderWriterLock.cs 2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ReaderWriterLock.cs 2007-05-01 
15:28:29 UTC (rev 76530)
@@ -35,8 +35,16 @@
 
 using System.Collections;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class ReaderWriterLock
        {
                private int seq_num = 1;
@@ -53,12 +61,18 @@
                }
 
                public bool IsReaderLockHeld {
+#if NET_2_0
+                       [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
+#endif
                        get {
                                lock (this) return reader_locks.ContainsKey 
(Thread.CurrentThreadId);
                        }
                }
 
                public bool IsWriterLockHeld {
+#if NET_2_0
+                       [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
+#endif
                        get {
                                lock (this) return (state < 0 && 
Thread.CurrentThreadId == writer_lock_owner);
                        }
@@ -187,6 +201,9 @@
                        return cookie;
                }
                
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
+#endif
                public void ReleaseReaderLock()
                {
                        lock (this) {
@@ -220,6 +237,9 @@
                                writer_queue.Pulse ();
                }
 
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
+#endif
                public void ReleaseWriterLock()
                {
                        lock (this) {

Modified: trunk/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs     
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs     
2007-05-01 15:28:29 UTC (rev 76530)
@@ -31,9 +31,15 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class RegisteredWaitHandle : MarshalByRefObject
        {
                WaitHandle _waitObject;
@@ -97,6 +103,9 @@
                        }
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public bool Unregister(WaitHandle waitObject) 
                {
                        lock (this) 

Modified: trunk/mcs/class/corlib/System.Threading/SendOrPostCallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/SendOrPostCallback.cs       
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/SendOrPostCallback.cs       
2007-05-01 15:28:29 UTC (rev 76530)
@@ -30,11 +30,8 @@
 
 #if NET_2_0
 
-using System.Runtime.InteropServices;
-
 namespace System.Threading 
 {
-       [ComVisible (false)]
        public delegate void SendOrPostCallback (object state);
 }
 

Modified: 
trunk/mcs/class/corlib/System.Threading/SynchronizationLockException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/SynchronizationLockException.cs     
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/SynchronizationLockException.cs     
2007-05-01 15:28:29 UTC (rev 76530)
@@ -32,9 +32,16 @@
 
 using System.Runtime.Serialization;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
 namespace System.Threading
 {
        [Serializable]
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public class SynchronizationLockException : SystemException
        {
                public SynchronizationLockException()

Modified: trunk/mcs/class/corlib/System.Threading/ThreadAbortException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadAbortException.cs     
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadAbortException.cs     
2007-05-01 15:28:29 UTC (rev 76530)
@@ -33,9 +33,16 @@
 using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
 namespace System.Threading
 {
        [Serializable]
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class ThreadAbortException : SystemException
        {
                private ThreadAbortException () : base ("Thread was being 
aborted")

Modified: trunk/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs       
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs       
2007-05-01 15:28:29 UTC (rev 76530)
@@ -32,9 +32,16 @@
 
 using System.Runtime.Serialization;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
 namespace System.Threading
 {
        [Serializable]
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public class ThreadInterruptedException : SystemException
        {
                public ThreadInterruptedException()

Modified: trunk/mcs/class/corlib/System.Threading/ThreadPool.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadPool.cs       2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadPool.cs       2007-05-01 
15:28:29 UTC (rev 76530)
@@ -156,6 +156,14 @@
                                                            (long) 
millisecondsTimeOutInterval, executeOnlyOnce);
                }
 
+#if NET_2_0
+               [CLSCompliant (false)]
+               unsafe public static bool UnsafeQueueNativeOverlapped 
(NativeOverlapped *overlapped)
+               {
+                       throw new NotImplementedException ();
+               }
+#endif
+
                [SecurityPermission (SecurityAction.Demand, 
ControlEvidence=true, ControlPolicy=true)]
                public static bool UnsafeQueueUserWorkItem (WaitCallback 
callback, object state)
                {

Modified: trunk/mcs/class/corlib/System.Threading/ThreadPriority.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadPriority.cs   2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadPriority.cs   2007-05-01 
15:28:29 UTC (rev 76530)
@@ -34,6 +34,7 @@
 
 #if NET_2_0
 using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
 #endif
 
 namespace System.Threading {
@@ -43,6 +44,7 @@
        /// </summary>
 #if NET_2_0
        [Serializable]
+       [ComVisible (true)]
 #endif
        public enum ThreadPriority {
 

Modified: trunk/mcs/class/corlib/System.Threading/ThreadStart.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadStart.cs      2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadStart.cs      2007-05-01 
15:28:29 UTC (rev 76530)
@@ -30,8 +30,14 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public delegate void ThreadStart();
 }

Modified: trunk/mcs/class/corlib/System.Threading/ThreadState.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadState.cs      2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadState.cs      2007-05-01 
15:28:29 UTC (rev 76530)
@@ -34,6 +34,7 @@
 
 #if NET_2_0
 using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
 #endif
 
 namespace System.Threading {
@@ -41,6 +42,7 @@
        [Flags]
 #if NET_2_0
        [Serializable]
+       [ComVisible (true)]
 #endif
        public enum ThreadState {
                Running = 0x00000000,

Modified: trunk/mcs/class/corlib/System.Threading/ThreadStateException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ThreadStateException.cs     
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/ThreadStateException.cs     
2007-05-01 15:28:29 UTC (rev 76530)
@@ -32,9 +32,16 @@
 
 using System.Runtime.Serialization;
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
 namespace System.Threading
 {
        [Serializable]
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public class ThreadStateException : SystemException
        {
                public ThreadStateException()

Modified: trunk/mcs/class/corlib/System.Threading/TimerCallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/TimerCallback.cs    2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/TimerCallback.cs    2007-05-01 
15:28:29 UTC (rev 76530)
@@ -30,8 +30,14 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public delegate void TimerCallback(object state);
 }

Modified: trunk/mcs/class/corlib/System.Threading/WaitCallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/WaitCallback.cs     2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/WaitCallback.cs     2007-05-01 
15:28:29 UTC (rev 76530)
@@ -30,8 +30,14 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public delegate void WaitCallback(object state);
 }

Modified: trunk/mcs/class/corlib/System.Threading/WaitHandle.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/WaitHandle.cs       2007-05-01 
15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/WaitHandle.cs       2007-05-01 
15:28:29 UTC (rev 76530)
@@ -37,10 +37,14 @@
 #if NET_2_0
 using System.Runtime.InteropServices;
 using Microsoft.Win32.SafeHandles;
+using System.Runtime.ConstrainedExecution;
 #endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public abstract class WaitHandle : MarshalByRefObject, IDisposable
        {
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -138,12 +142,18 @@
                private static extern int WaitAny_internal(WaitHandle[] 
handles, int ms, bool exitContext);
 
                // LAMESPEC: Doesn't specify how to signal failures
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.MayFail)]
+#endif
                public static int WaitAny(WaitHandle[] waitHandles)
                {
                        CheckArray (waitHandles, false);
                        return(WaitAny_internal(waitHandles, Timeout.Infinite, 
false));
                }
 
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.MayFail)]
+#endif
                public static int WaitAny(WaitHandle[] waitHandles,
                                          int millisecondsTimeout,
                                          bool exitContext)
@@ -158,6 +168,9 @@
                        }
                }
 
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.MayFail)]
+#endif
                public static int WaitAny(WaitHandle[] waitHandles,
                                          TimeSpan timeout, bool exitContext)
                {
@@ -177,7 +190,12 @@
                }
 
                [MonoTODO]
-               public WaitHandle() {
+#if NET_2_0
+               protected
+#else
+               public
+#endif
+               WaitHandle() {
                        // FIXME
                }
 
@@ -235,10 +253,12 @@
                }
 
                public SafeWaitHandle SafeWaitHandle {
+                       [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.MayFail)]
                        get {
                                return safe_wait_handle;
                        }
 
+                       [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
                        set {
                                if (safe_wait_handle != null)
                                        safe_wait_handle.Close ();
@@ -247,6 +267,28 @@
                        }
                }
 
+               public static bool SignalAndWait (WaitHandle toSignal,
+                                                 WaitHandle toWaitOn)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public static bool SignalAndWait (WaitHandle toSignal,
+                                                 WaitHandle toWaitOn,
+                                                 int millisecondsTimeout,
+                                                 bool exitContext)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public static bool SignalAndWait (WaitHandle toSignal,
+                                                 WaitHandle toWaitOn,
+                                                 TimeSpan timeout,
+                                                 bool exitContext)
+               {
+                       throw new NotImplementedException ();
+               }
+
                public virtual bool WaitOne()
                {
                        CheckDisposed ();

Modified: trunk/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs      
2007-05-01 15:11:29 UTC (rev 76529)
+++ trunk/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs      
2007-05-01 15:28:29 UTC (rev 76530)
@@ -30,8 +30,14 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
 
 namespace System.Threading
 {
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public delegate void WaitOrTimerCallback(object state, bool timedOut);
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to