2 using System
.Threading
;
4 public class Critical
{
8 Program
.mre2
.WaitOne ();
10 throw new Exception ();
12 Console
.WriteLine ("Catched exception in cctor");
13 Program
.catched_exception
= true;
19 public class Program
{
20 public static ManualResetEvent mre1
= new ManualResetEvent (false);
21 public static ManualResetEvent mre2
= new ManualResetEvent (false);
23 public static bool catched_exception
, catched_abort
;
25 public static int Main (string[] args
)
27 Thread thread
= new Thread (DoStuff
);
36 if (!catched_exception
)
41 Console
.WriteLine ("done, all things good");
45 public static void DoStuff ()
49 } catch (ThreadAbortException
) {
50 Console
.WriteLine ("Catched thread abort");
51 Program
.catched_abort
= true;