[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
[mono.git] / mono / tests / threadpool-exceptions1.cs
1 using System;
2 using System.Threading;
3
4 class Test {
5         static object monitor;
6
7         static int Main ()
8         {
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);
16                 }
17                 Thread.Sleep (1000);
18                 return 1;
19         }
20
21         static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
22         {
23                 lock (monitor) {
24                         Monitor.Pulse (monitor);
25                 }
26                 Environment.Exit (0);
27         }
28 }
29