Update Haiku support (#15674)
[mono-project.git] / mono / tests / abort-stress-1.cs
blobde913b3f9264b925f0a79df6cbf5990fed3cf8ec
1 //
2 // This is:
3 //
4 // http://bugzilla.ximian.com/show_bug.cgi?id=72741
5 //
7 using System;
8 using System.Threading;
10 class T {
11 static int loops = 20;
12 static int threads = 100;
14 static void worker () {
15 while (true)
16 Thread.Sleep (10);
19 static void doit () {
20 Thread[] ta = new Thread [threads];
21 for (int i = 0; i < threads; ++i) {
22 ta [i] = new Thread (new ThreadStart (worker));
23 ta [i].Start ();
25 for (int i = 0; i < threads; ++i) {
26 ta [i].Abort ();
29 static void Main (string[] args) {
30 if (args.Length > 0)
31 loops = int.Parse (args [0]);
32 if (args.Length > 1)
33 threads = int.Parse (args [1]);
34 for (int i = 0; i < loops; ++i) {
35 Console.Write ('.');
36 doit ();