Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / abort-stress-3.cs
1 //
2 // This is:
3 //
4 // http://bugzilla.ximian.com/show_bug.cgi?id=76047
5 //
6
7 using System;
8 using System.Threading;
9
10 class Tests
11 {
12         static int loops = 20;
13         static int threads = 100;
14         
15         static void Empty () {}
16    
17         static void Create () {
18                 Thread t = new Thread (new ThreadStart (Empty));
19                 t.Start ();
20                 
21                 Thread.Sleep(1000);
22                 
23                 t.Abort ();
24         }
25    
26         static void doit () {
27                 for (int i = 0; i < threads; i++)
28                         new Thread (new ThreadStart (Create)).Start ();
29         }
30
31         public static void Main (String[] args) {
32           if (args.Length > 0)
33                   loops = int.Parse (args [0]);
34           if (args.Length > 1)
35                   threads = int.Parse (args [1]);
36           for (int i = 0; i < loops; ++i) {
37                   Console.Write ('.');
38                   doit ();
39           }
40   }  
41 }
42
43