3 using System.Collections;
4 using System.Threading;
7 public static LocalDataStoreSlot dataslot = Thread.AllocateDataSlot();
10 string ID=(string)Thread.GetData(dataslot);
12 Console.WriteLine("Set ID: foo");
13 Thread.SetData(dataslot, "foo");
15 Console.WriteLine("finalizer thread ID: {0}", (string)Thread.GetData(dataslot));
19 public static int Main() {
20 ArrayList list = new ArrayList ();
21 Thread.SetData(dataslot, "ID is wibble");
22 Environment.ExitCode = 2;
24 foo instance = new foo();
25 list.Add (new WeakReference(instance));