Permalink
Browse files

2005-09-30 Zoltan Varga <vargaz@gmail.com>

	* abort-stress-3.cs: New file.

svn path=/trunk/mono/; revision=51049
  • Loading branch information...
1 parent 72e5d21 commit 228805b4598747b4e6e5e42d4918791a03304dba @vargaz vargaz committed Sep 30, 2005
Showing with 44 additions and 0 deletions.
  1. +1 −0 mono/tests/Makefile.am
  2. +43 −0 mono/tests/abort-stress-3.cs
@@ -24,6 +24,7 @@ BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
STRESS_TESTS_SRC= \
abort-stress-1.cs \
abort-stress-2.cs \
+ abort-stress-3.cs \
domain-stress.cs \
gchandle-stress.cs \
monitor-stress.cs \
@@ -0,0 +1,43 @@
+//
+// This is:
+//
+// http://bugzilla.ximian.com/show_bug.cgi?id=76047
+//
+
+using System;
+using System.Threading;
+
+class Tests
+{
+ static int loops = 20;
+ static int threads = 100;
+
+ static void Empty () {}
+
+ static void Create () {
+ Thread t = new Thread (new ThreadStart (Empty));
+ t.Start ();
+
+ Thread.Sleep(1000);
+
+ t.Abort ();
+ }
+
+ static void doit () {
+ for (int i = 0; i < threads; i++)
+ new Thread (new ThreadStart (Create)).Start ();
+ }
+
+ public static void Main (String[] args) {
+ if (args.Length > 0)
+ loops = int.Parse (args [0]);
+ if (args.Length > 1)
+ threads = int.Parse (args [1]);
+ for (int i = 0; i < loops; ++i) {
+ Console.Write ('.');
+ doit ();
+ }
+ }
+}
+
+

0 comments on commit 228805b

Please sign in to comment.