[runtime] Accomplish BITCODE build symbol sharing with only make (#3329)
[mono-project.git] / mono / tests / threadpool-exceptions4.cs
blob58b3a4ac2f5c3c7db2a459aa63384dcbc686d1d9
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 WaitCallback wcb = new WaitCallback ((a) => {
12 throw new Exception ("From the threadpoool");
13 });
14 wcb.BeginInvoke (wcb, OnCBFinished, null);
15 lock (monitor) {
16 Monitor.Wait (monitor);
18 Thread.Sleep (1000);
19 return 1;
22 static void OnCBFinished (object arg)
24 throw new Exception ("From OnCBFinished");
27 static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
29 lock (monitor) {
30 Monitor.Pulse (monitor);
32 Environment.Exit (0);