[Mono-bugs] [Bug 65414][Nor] New - Thread Local Data Slots do not survive nested appdomain transitions
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 6 Sep 2004 21:18:55 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=65414
--- shadow/65414 2004-09-06 21:18:55.000000000 -0400
+++ shadow/65414.tmp.15548 2004-09-06 21:18:55.000000000 -0400
@@ -0,0 +1,49 @@
+Bug#: 65414
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: bmaurer@users.sf.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Thread Local Data Slots do not survive nested appdomain transitions
+
+Consider this test case:
+
+using System;
+using System.Threading;
+
+class X : MarshalByRefObject {
+ static LocalDataStoreSlot slot;
+ static void Main () {
+ AppDomain ad = AppDomain.CreateDomain ("MyFriendlyDomain");
+ X x = (X) ad.CreateInstanceFromAndUnwrap ("t.exe", "X");
+
+ slot = Thread.AllocateDataSlot ();
+ Thread.SetData (slot, "hello");
+
+ x.Foo (AppDomain.CurrentDomain);
+ }
+
+
+ public void Foo (AppDomain ad)
+ {
+ ad.DoCallBack (new CrossAppDomainDelegate (Bar));
+ }
+
+ public static void Bar ()
+ {
+ Console.WriteLine ("slot value is {0}", Thread.GetData (slot));
+ }
+}
+
+The value of "slot" printed should be `hello'. In the root appdomain, this
+is the slot's value. However, this value is not printed. the value is null