Author: spouliot
Date: 2005-04-28 09:30:19 -0400 (Thu, 28 Apr 2005)
New Revision: 43721

Modified:
   trunk/mcs/class/corlib/System.Threading/ChangeLog
   trunk/mcs/class/corlib/System.Threading/Thread.cs
Log:
2005-04-28  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * Thread.cs: Added property to get the ExecutionContext in 2.0. Fixed
        GetCompressedStack and made SetCompressedStack available (as internal)
        before NET_2_0.



Modified: trunk/mcs/class/corlib/System.Threading/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Threading/ChangeLog   2005-04-28 13:27:13 UTC 
(rev 43720)
+++ trunk/mcs/class/corlib/System.Threading/ChangeLog   2005-04-28 13:30:19 UTC 
(rev 43721)
@@ -1,3 +1,9 @@
+2005-04-28  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * Thread.cs: Added property to get the ExecutionContext in 2.0. Fixed
+       GetCompressedStack and made SetCompressedStack available (as internal)
+       before NET_2_0.
+
 2005-04-28  Sebastien Pouliot  <[EMAIL PROTECTED]> 
  
        * AsyncFlowControl.cs: Updated wrt beta2.

Modified: trunk/mcs/class/corlib/System.Threading/Thread.cs
===================================================================
--- trunk/mcs/class/corlib/System.Threading/Thread.cs   2005-04-28 13:27:13 UTC 
(rev 43720)
+++ trunk/mcs/class/corlib/System.Threading/Thread.cs   2005-04-28 13:30:19 UTC 
(rev 43721)
@@ -842,10 +842,14 @@
                        stack_size = maxStackSize;
                }
 
-               [MonoTODO]
+               [MonoTODO ("limited to CompressedStack support")]
                public ExecutionContext ExecutionContext {
                        [ReliabilityContract (Consistency.WillNotCorruptState, 
CER.MayFail)]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               if (_ec == null)
+                                       _ec = new ExecutionContext ();
+                               return _ec;
+                       }
                }
 
                public int ManagedThreadId {
@@ -905,23 +909,6 @@
                        }
                }
 
-               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = 
true)]
-               [StrongNameIdentityPermission (SecurityAction.LinkDemand, 
PublicKey="00000000000000000400000000000000")]
-               public CompressedStack GetCompressedStack ()
-               {
-                       // Note: returns null if no CompressedStack has been 
set.
-                       // However CompressedStack.GetCompressedStack returns 
an 
-                       // (empty?) CompressedStack instance.
-                       return _stack;
-               }
-
-               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = 
true)]
-               [StrongNameIdentityPermission (SecurityAction.LinkDemand, 
PublicKey="00000000000000000400000000000000")]
-               public void SetCompressedStack (CompressedStack stack)
-               {
-                       _stack = stack;
-               }
-
                [ComVisible (false)]
                public override int GetHashCode ()
                {
@@ -935,11 +922,6 @@
                        Start ();
                }
 #else
-               internal CompressedStack GetCompressedStack ()
-               {
-                       return _stack;
-               }
-
                internal ExecutionContext ExecutionContext {
                        get {
                                if (_ec == null)
@@ -948,6 +930,33 @@
                        }
                }
 #endif
+
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = 
true)]
+               [StrongNameIdentityPermission (SecurityAction.LinkDemand, 
PublicKey="00000000000000000400000000000000")]
+#if NET_2_0
+               public
+#else
+               internal
+#endif
+               CompressedStack GetCompressedStack ()
+               {
+                       // Note: returns null if no CompressedStack has been 
set.
+                       // However CompressedStack.GetCompressedStack returns 
an 
+                       // (empty?) CompressedStack instance.
+                       CompressedStack cs = 
ExecutionContext.SecurityContext.CompressedStack;
+                       return ((cs == null) || cs.IsEmpty ()) ? null : cs;
+               }
+
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = 
true)]
+               [StrongNameIdentityPermission (SecurityAction.LinkDemand, 
PublicKey="00000000000000000400000000000000")]
+#if NET_2_0
+               public
+#else
+               internal
+#endif
+               void SetCompressedStack (CompressedStack stack)
+               {
+                       ExecutionContext.SecurityContext.CompressedStack = 
stack;
+               }
        }
 }
-

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

Reply via email to