[corlib] Improve flow of ExecutionContext (few tests taken from https://github.com...
[mono.git] / mcs / class / corlib / System.Threading / Thread.cs
index d4a8d167a34246acea4db11c40161a6f6391add7..a52d8d1258506712ba856214353c4a4468fc517b 100644 (file)
@@ -696,8 +696,7 @@ namespace System.Threading {
 
                public void Start() {
                        // propagate informations from the original thread to the new thread
-                       if (!ExecutionContext.IsFlowSuppressed ())
-                               ec_to_set = ExecutionContext.Capture ();
+                       ec_to_set = ExecutionContext.Capture (false, true);
                        Internal._serialized_principal = CurrentThread.Internal._serialized_principal;
 
                        // Thread_internal creates and starts the new thread, 
@@ -858,7 +857,6 @@ namespace System.Threading {
                        Internal.stack_size = CheckStackSize (maxStackSize);
                }
 
-               [MonoTODO ("limited to CompressedStack support")]
                public ExecutionContext ExecutionContext {
                        [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
                        get {
@@ -866,6 +864,9 @@ namespace System.Threading {
                                        _ec = new ExecutionContext ();
                                return _ec;
                        }
+                       internal set {
+                               _ec = value;
+                       }
                }
 
                public int ManagedThreadId {