using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace Test { public class Program { static void Main(string[] args) { Console.WriteLine("Thread Start/Stop/Join Sample"); Alpha oAlpha = new Alpha(); Thread oThread=new Thread(new ThreadStart(oAlpha.Beta)); //Start a Thread oThread.Start(); while (!oThread.IsAlive) { Thread.Sleep(1); oThread.Abort(); oThread.Join(); Console.WriteLine(); Console.WriteLine("Alpha.Beta has finished"); try { Console.WriteLine("Alpha.Beta Try To Restart Thread"); oThread.Start(); } catch (ThreadStateException) { } } } } public class Alpha { public void Beta() { while (true) { Console.WriteLine("Alpha.beta is runing int its own thread!"); } } } }