[System] Use GZipStream from corefx
[mono-project.git] / mono / tests / threadpool-exceptions1.cs
blob37809bc947901d73ddd5b5feb537558300331521
1 using System;
2 using System.Threading;
4 class Test {
5 static object monitor;
7 static int Main ()
9 monitor = new object ();
10 AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
11 ThreadPool.QueueUserWorkItem ((a) => {
12 throw new Exception ("From the threadpoool");
13 });
14 lock (monitor) {
15 Monitor.Wait (monitor);
17 Thread.Sleep (1000);
18 return 1;
21 static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
23 lock (monitor) {
24 Monitor.Pulse (monitor);
26 Environment.Exit (0);