2 using System
.Threading
;
3 using System
.Threading
.Tasks
;
7 static ManualResetEvent master_mre
= new ManualResetEvent (false);
8 static ManualResetEvent async_mre
= new ManualResetEvent (false);
12 public static int Main ()
18 throw new ApplicationException (pos
.ToString ());
24 if (!async_mre
.WaitOne (3000))
28 throw new ApplicationException (pos
.ToString ());
33 static async void TestAsync ()
37 await RunAsync ().ConfigureAwait (false);
40 throw new ApplicationException (pos
.ToString ());
46 static Task
RunAsync ()
48 return Task
.Factory
.StartNew (() => {
49 master_mre
.WaitOne ();
50 Console
.WriteLine ("Hello async");
52 throw new ApplicationException (pos
.ToString ());