2009-05-26 Mark Probst <mark.probst@gmail.com>
authorMark Probst <mark.probst@gmail.com>
Tue, 26 May 2009 16:06:58 +0000 (16:06 -0000)
committerMark Probst <mark.probst@gmail.com>
Tue, 26 May 2009 16:06:58 +0000 (16:06 -0000)
        * Thread.cs: Don't set the execution context when creating a
        thread because the _ec member is thread static and we set the
        wrong one.  It's now set by the runtime.  We just provide the
        correct one.

        * Environment.cs: Bump corlib version.

svn path=/trunk/mcs/; revision=134773

mcs/class/corlib/System.Threading/Thread.cs
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Environment.cs

index 366272fb3bfdd16fe4f59f573395c201cb36b802..ead1be87751bcb5b4de0214cb667316d26573bb9 100644 (file)
@@ -102,6 +102,10 @@ namespace System.Threading {
                private int small_id;
                private IntPtr manage_callback;
                private object pending_exception;
+               /* This is the ExecutionContext that will be set by
+                  start_wrapper() in the runtime. */
+               private ExecutionContext ec_to_set;
+
                /* 
                 * These fields are used to avoid having to increment corlib versions
                 * when a new field is added to the unmanaged MonoThread structure.
@@ -118,6 +122,9 @@ namespace System.Threading {
                [ThreadStatic] 
                static object[] local_slots;
 
+               /* The actual ExecutionContext of the thread.  It's
+                  ThreadStatic so that it's not shared between
+                  AppDomains. */
                [ThreadStatic]
                static ExecutionContext _ec;
 
@@ -764,12 +771,12 @@ namespace System.Threading {
                        // propagate informations from the original thread to the new thread
 #if NET_2_0
                        if (!ExecutionContext.IsFlowSuppressed ())
-                               _ec = ExecutionContext.Capture ();
+                               ec_to_set = ExecutionContext.Capture ();
 #else
                        // before 2.0 this was only used for security (mostly CAS) so we
                        // do this only if the security manager is active
                        if (SecurityManager.SecurityEnabled)
-                               _ec = ExecutionContext.Capture ();
+                               ec_to_set = ExecutionContext.Capture ();
 #endif
                        if (CurrentThread._principal != null)
                                _principal = CurrentThread._principal;
index 6e4ad4c098ae6177f8b4f4e1db2b42c07a413325..447dde7919a59b3bf8918854a8904232039a81e7 100644 (file)
@@ -1,3 +1,12 @@
+2009-05-26  Mark Probst  <mark.probst@gmail.com>
+
+       * Thread.cs: Don't set the execution context when creating a
+       thread because the _ec member is thread static and we set the
+       wrong one.  It's now set by the runtime.  We just provide the
+       correct one.
+
+       * Environment.cs: Bump corlib version.
+
 2009-05-22  Zoltan Varga  <vargaz@gmail.com>
 
        * Tuple.cs Tuples.cs: New files.
index d4afb6f4300cb280ba3c2dd42114b57e7b9fd261..7e7ea4a19cbbcf542e91469fc9bef7a83f561f37 100644 (file)
@@ -63,7 +63,7 @@ namespace System {
                 * Changes which are already detected at runtime, like the addition
                 * of icalls, do not require an increment.
                 */
-               private const int mono_corlib_version = 76;
+               private const int mono_corlib_version = 77;
 
 #if NET_2_0
                [ComVisible (true)]