From: Alexander Kyte Date: Mon, 16 Mar 2015 21:26:53 +0000 (-0400) Subject: [corlib] Fixed change in 4b4ddb66b3 that prevented use of remoting fast path. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=9d6859ddf212ca68ad34dda8bd35c60cd5b5ed3c;p=mono.git [corlib] Fixed change in 4b4ddb66b3 that prevented use of remoting fast path. --- diff --git a/mcs/class/corlib/System.Threading/ExecutionContext.cs b/mcs/class/corlib/System.Threading/ExecutionContext.cs index 5602435bded..0396aada1b3 100644 --- a/mcs/class/corlib/System.Threading/ExecutionContext.cs +++ b/mcs/class/corlib/System.Threading/ExecutionContext.cs @@ -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)