Thread.SetData : Thread « System.Threading « C# / C Sharp by API






Thread.SetData

  
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
using System.Threading;

public class MainClass
{
    public static void Main()
    {
        LocalDataStoreSlot slot = Thread.AllocateDataSlot();
        Thread.SetData(slot, 63);

        int slotValue1 = (int)Thread.GetData(slot);
        Console.WriteLine(slotValue1);

    }
}

   
    
  








Related examples in the same category

1.new Thread()
2.Thread.Abort()
3.Thread.AllocateDataSlot
4.Thread.AllocateNamedDataSlot
5.Thread.CurrentContext
6.Thread.CurrentCulture
7.Thread.CurrentThread
8.Thread.GetData
9.Thread.GetHashCode()
10.Thread.Interrupt()
11.Thread.IsAlive
12.Thread.IsBackground
13.Thread.Join()
14.Thread.Priority
15.Thread.ResetAbort()
16.Thread.Sleep
17.Thread.Start
18.Thread.ThreadState