new ThreadStart : ThreadStart : Thread C# Source Code


Custom Search

C# Source Code » Thread » ThreadStart »

 

new ThreadStart








    
 

using System;
using System.Threading;

public class SimpleThread {
    public void SimpleMethod() {
        int result = 1;
        Console.WriteLine(result.ToString() + " from thread ID: " +
                          AppDomain.GetCurrentThreadId().ToString());
    }

    public static void Main() {
        SimpleThread simpleThread = new SimpleThread();
        simpleThread.SimpleMethod();

        ThreadStart ts = new ThreadStart(simpleThread.SimpleMethod);
        Thread t = new Thread(ts);
        t.Start();
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Thread
» ThreadStart