2 using System
.Threading
;
3 using System
.Threading
.Tasks
;
7 static bool unobserved
;
9 public static int Main ()
11 TaskScheduler
.UnobservedTaskException
+= TaskScheduler_UnobservedTaskException
;
16 GC
.WaitForPendingFinalizers ();
22 TaskScheduler
.UnobservedTaskException
-= TaskScheduler_UnobservedTaskException
;
26 static void TaskScheduler_UnobservedTaskException (object sender
, UnobservedTaskExceptionEventArgs e
)
29 Console
.WriteLine ("unobserved");
32 static async Task
Test ()
40 static async Task
ThrowAsync()
44 throw new Exception ("boom");