2010-02-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / abort-stress-3.cs
blobbc8d298b04f43348894c14adf183bef5398ca7d8
1 //
2 // This is:
3 //
4 // http://bugzilla.ximian.com/show_bug.cgi?id=76047
5 //
7 using System;
8 using System.Threading;
10 class Tests
12 static int loops = 20;
13 static int threads = 100;
15 static void Empty () {}
17 static void Create () {
18 Thread t = new Thread (new ThreadStart (Empty));
19 t.Start ();
21 Thread.Sleep(1000);
23 t.Abort ();
26 static void doit () {
27 for (int i = 0; i < threads; i++)
28 new Thread (new ThreadStart (Create)).Start ();
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 ();