linux-packaging-mono/mono/tests/threadpool-exceptions3.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

22 lines
438 B
C#

using System;
using System.Threading;
class Test {
static int Main ()
{
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
WaitCallback wcb = new WaitCallback ((a) => {
throw new Exception ("From the threadpoool");
});
wcb.BeginInvoke (wcb, null, null);
Thread.Sleep (1000);
return 0;
}
static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
{
Environment.Exit (1);
}
}