Align libgc vcxproj with makefile.
[mono.git] / mono / tests / abort-stress-2.cs
1 //
2 // This is:
3 //
4 // http://bugzilla.ximian.com/show_bug.cgi?id=72740
5 //
6
7 using System;
8 using System.Threading;
9
10 class T {
11         static int loops = 20;
12         static int threads = 100;
13
14         static void worker () {
15                 // This hits alot of runtime code.
16                 while (true)
17                         typeof (object).Assembly.GetTypes ();
18         }
19
20         static void doit () {
21                 Thread[] ta = new Thread [threads];
22                 for (int i = 0; i < threads; ++i) {
23                         ta [i] = new Thread (new ThreadStart (worker));
24                         ta [i].Start ();
25                 }
26                 for (int i = 0; i < threads; ++i) {
27                         ta [i].Abort ();
28                 }
29         }
30         static void Main (string[] args) {
31                 if (args.Length > 0)
32                         loops = int.Parse (args [0]);
33                 if (args.Length > 1)
34                         threads = int.Parse (args [1]);
35                 for (int i = 0; i < loops; ++i) {
36                         Console.Write ('.');
37                         doit ();
38                 }
39         }
40 }
41