* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / corlib / System.Threading / SynchronizationContext.cs
index 1648adead7352cd44b57c6fa187e26ce1e6e2a9e..6ede32d76245ec724a7cf0fc8ec5a96a35de798e 100644 (file)
@@ -35,6 +35,8 @@ namespace System.Threading
 {
        public class SynchronizationContext
        {
+               bool notification_required;
+
                [ThreadStatic]
                static SynchronizationContext currentContext;
                
@@ -57,33 +59,34 @@ namespace System.Threading
                        return new SynchronizationContext (this);
                }
 
-               [MonoTODO]
                public bool IsWaitNotificationRequired ()
                {
-                       throw new NotImplementedException ();
+                       return notification_required;
                }
 
-               [MonoTODO]
                public virtual void OperationCompleted ()
                {
-                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public virtual void OperationStarted ()
                {
-                       throw new NotImplementedException ();
                }
                
                public virtual void Post (SendOrPostCallback d, object state)
                {
-                       d.BeginInvoke (state, null, null);
+                       ThreadPool.QueueUserWorkItem (new WaitCallback (d), state);
                }
                
                public virtual void Send (SendOrPostCallback d, object state)
                {
                        d (state);
                }
+
+               [Obsolete ("does not exists anymore in 2.0 beta2")]
+               public virtual void SendOrPost (SendOrPostCallback d, object state)
+               {
+                       Send (d, state);
+               }
                
                [MonoTODO]
                public static void SetSynchronizationContext (SynchronizationContext syncContext)
@@ -94,6 +97,7 @@ namespace System.Threading
                [MonoTODO]
                protected void SetWaitNotificationRequired ()
                {
+                       notification_required = true;
                        throw new NotImplementedException ();
                }