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






Thread.AllocateNamedDataSlot

  
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()
    {
        Thread.SetData(Thread.AllocateNamedDataSlot("TestSlot"), 126);
        int slotValue2 = (int)Thread.GetData(Thread.GetNamedDataSlot("TestSlot"));
        Console.WriteLine(slotValue2);
    }
}

   
    
  








Related examples in the same category

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