1 // Compiler options: -langversion:future
3 using System.Threading;
4 using System.Threading.Tasks;
8 static ManualResetEvent master_mre = new ManualResetEvent (false);
9 static ManualResetEvent async_mre = new ManualResetEvent (false);
19 throw new ApplicationException (pos.ToString ());
25 if (!async_mre.WaitOne (3000))
29 throw new ApplicationException (pos.ToString ());
34 static async void TestAsync ()
41 throw new ApplicationException (pos.ToString ());
47 static Task RunAsync ()
49 return Task.Factory.StartNew (() => {
50 master_mre.WaitOne ();
51 Console.WriteLine ("Hello async");
53 throw new ApplicationException (pos.ToString ());