Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / threadpool-exceptions3.cs
1 using System;
2 using System.Threading;
3
4 class Test {
5         static int Main ()
6         {
7                 AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
8                 WaitCallback wcb = new WaitCallback ((a) => {
9                         throw new Exception ("From the threadpoool");
10                 });
11                 wcb.BeginInvoke (wcb, null, null);
12                 Thread.Sleep (1000);
13                 return 0;
14         }
15
16         static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
17         {
18                 Environment.Exit (1);
19         }
20 }
21