Thread-local-storage : LocalDataStoreSlot : Thread C# Examples


C# Examples » Thread » LocalDataStoreSlot »

 

Thread-local-storage









    
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;

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

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

        }
}
    
   
  
   



Output

63


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» LocalDataStoreSlot