Bump external/ikdasm to master.
[mono-project.git] / mono / tests / thread-exit.cs
blobca87bc9e2c3f43e949c23c3f8bf9515923cb6f68
1 using System;
2 using System.Threading;
4 class FibThread {
5 static long fib (long n) {
6 if (n < 2)
7 return n;
8 else
9 return fib (n - 1) + fib (n - 2);
12 public void work () {
13 for (long i = 0; i < 30; ++i)
14 Console.WriteLine (fib (i).ToString ());
15 Console.WriteLine ("exiting");
16 System.Environment.Exit (0);
20 public class Test {
21 public static Thread newThread () {
22 FibThread ft = new FibThread ();
23 return new Thread (new ThreadStart (ft.work));
26 static int Main () {
27 Thread t = newThread ();
28 t.Start ();
29 Console.WriteLine ("started");
30 return 1;