Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / subthread-exit.cs
1
2 using System;
3 using System.Threading;
4
5 public class foo {
6         public static int Main() {
7                 Thread thr=new Thread(new ThreadStart(foo.thread));
8                 thr.Start();
9                 Thread.Sleep(1200);
10                 Console.WriteLine("Main thread returns");
11                 // the subthread calls Exit(0) before we reach here
12                 return 1;
13         }
14
15         public static void thread() {
16                 Console.WriteLine("Thread running");
17                 Thread.Sleep(500);
18                 Console.WriteLine("Thread exiting");
19                 Environment.Exit(0);
20         }
21 }
22