Set main thread's name : Main Thread : Thread C# Examples


C# Examples » Thread » Main Thread »

 

Set main thread's name









    
using  System;  
using  System.Threading;  
  
class  MainClass  {  
    public  static  void  Main()  {  
        Thread  thrd  =  Thread.CurrentThread;  
  
        thrd.Name  =  "Main  Thread";  
  
        Console.WriteLine("Main  thread  is  now  called:  "  +  thrd.Name);  
    }  
}
    
   
  
   



Output

Main thread is now called: Main Thread


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Main Thread