3 using System.Threading;
6 public static int Main() {
7 Thread thr=new Thread(new ThreadStart(foo.thread));
10 Console.WriteLine("Main thread returns");
11 // the subthread calls Exit(0) before we reach here
15 public static void thread() {
16 Console.WriteLine("Thread running");
18 Console.WriteLine("Thread exiting");