update readme (#21797)
[mono-project.git] / mono / tests / threadpool-exceptions1.cs
blobc1b8406cd47f2ea54ea67f1f634b945cf6ac474e
1 using System;
2 using System.Threading;
4 class Test {
5 static int Main ()
7 AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
8 ThreadPool.QueueUserWorkItem ((a) => {
9 throw new Exception ("From the threadpoool");
10 });
12 // Should not finish, OnUnhandledException exit path is expected to be executed
13 Thread.Sleep (10000);
15 return 3;
18 static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
20 Environment.Exit (0);