Merge pull request #2353 from ludovic-henry/fix-servicemodel-15153
[mono.git] / mono / tests / unhandled-exception-1.cs
1 using System;
2 using System.Diagnostics;
3 using System.Threading;
4 using System.Threading.Tasks;
5
6 class CustomException : Exception
7 {
8 }
9
10 class Driver
11 {
12         /* Expected exit code: 1 */
13         static void Main (string[] args)
14         {
15                 ManualResetEvent mre = new ManualResetEvent (false);
16
17                 var t = new Thread (new ThreadStart (() => { try { throw new CustomException (); } finally { mre.Set (); } }));
18                 t.Start ();
19
20                 if (!mre.WaitOne (5000))
21                         Environment.Exit (2);
22
23                 t.Join ();
24
25                 Environment.Exit (0);
26         }
27 }