[corlib] Fixed change in 4b4ddb66b3 that prevented use of remoting fast path.
authorAlexander Kyte <alexander.kyte@xamarin.com>
Mon, 16 Mar 2015 21:26:53 +0000 (17:26 -0400)
committerAlexander Kyte <alexander.kyte@xamarin.com>
Tue, 17 Mar 2015 14:24:47 +0000 (10:24 -0400)
mcs/class/corlib/System.Threading/ExecutionContext.cs

index 5602435bdede65880dd2536afc75640fd8befaa2..0396aada1b3f5dc9c14193f7bef097f2d1eb3ecf 100644 (file)
@@ -34,6 +34,7 @@ using System.Runtime.Serialization;
 using System.Security;
 using System.Security.Permissions;
 using System.Runtime.Remoting.Messaging;
+using System.Collections;
 using System.Collections.Generic;
 
 namespace System.Threading {
@@ -255,14 +256,17 @@ namespace System.Threading {
                internal static LogicalCallContext CreateLogicalCallContext (bool createEmpty)
                {
                        var lcc = Current._lcc;
-                       if (lcc == null) {
-                               if (createEmpty)
-                                       lcc = new LogicalCallContext ();
+                       LogicalCallContext ctx = null;
 
-                               return lcc;
-                       }
+                       if (lcc != null && lcc.HasInfo) {
+                               ctx = new LogicalCallContext ();
+                               foreach (DictionaryEntry entry in lcc.Datastore) {
+                                       ctx.SetData ((string)entry.Key, entry.Value);
+                               }
+                       } else if (createEmpty)
+                               ctx = new LogicalCallContext ();
 
-                       return (LogicalCallContext) lcc.Clone ();
+                       return ctx;
                }
 
                internal void FreeNamedDataSlot (string name)