2 using System.Diagnostics;
3 using System.Threading;
4 using System.Threading.Tasks;
6 class CustomException : Exception
12 /* expected exit code: 0 */
13 static void Main (string[] args)
15 ManualResetEvent mre = new ManualResetEvent (false);
17 var a = new Action (() => { try { throw new CustomException (); } finally { mre.Set (); } });
18 var ares = a.BeginInvoke (null, null);
20 if (!mre.WaitOne (5000))
26 } catch (CustomException) {
27 } catch (Exception ex) {
28 Console.WriteLine (ex);