Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / thread-dump.cs
1 using System;
2 using System.Reflection;
3 using System.Threading;
4
5 //
6 // This is a test program for the thread dump support in the runtime
7 //
8 // Usage:
9 // - start it
10 // - send it a SIGQUIT signal using pkill -QUIT mono
11 //
12
13 public class Tests {
14
15         public static Object lock_object;
16
17         public static void run () {
18                 while (true)
19                         ;
20         }
21
22         public static void wait () {
23                 Monitor.Enter (lock_object);
24         }
25
26         public static void Main () {
27                 lock_object = new Object ();
28                 Monitor.Enter (lock_object);
29
30                 Thread.CurrentThread.Name = "Main";
31
32                 Thread t1 = new Thread (new ThreadStart (run));
33                 t1.Name = "Thread1";
34                 t1.Start ();
35                 Thread t2 = new Thread (new ThreadStart (run));
36                 t2.Name = "Thread2";
37                 t2.Start ();
38
39                 Thread t3 = new Thread (new ThreadStart (wait));
40                 t3.Name = "WaitThread";
41                 t3.Start ();
42
43         }
44 }
45