2010-06-21 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / gc-altstack.cs
blob89eb310c73ee7a78a49b73a8606027fa1537f032
1 using System;
2 using System.Threading;
3 using System.Collections;
5 class T {
7 static bool finished = false;
9 static void segv () {
10 while (true) {
11 if (finished)
12 break;
13 try {
14 object o = null;
15 o.ToString ();
16 } catch (NullReferenceException) {
21 static void Main (string[] args) {
22 /* Test for running a GC while executing a SIGSEGV handler on an altstack */
23 Thread t = new Thread (delegate () {
24 segv ();
25 });
27 t.Start ();
29 for (int i = 0; i < 100000; ++i) {
30 new ArrayList ();
33 finished = true;
35 t.Join ();