3 using System
.Threading
;
5 class CustomException
: Exception
11 /* expected exit code: 255 */
12 public static void Main ()
14 if (Environment
.GetEnvironmentVariable ("TEST_UNHANDLED_EXCEPTION_HANDLER") != null)
15 AppDomain
.CurrentDomain
.UnhandledException
+= (s
, e
) => {};
17 ManualResetEvent mre
= new ManualResetEvent(false);
19 ThreadPool
.RegisterWaitForSingleObject (mre
, (state
, timedOut
) => { throw new CustomException (); }
, null, -1, true);