2 using System
.Threading
;
3 using System
.Threading
.Tasks
;
7 public static int Main ()
9 var mre_l
= new ManualResetEvent (false);
10 var mre
= new ManualResetEvent (false);
12 Func
<string, Task
<string>> f
= async l
=>
13 await Task
.Factory
.StartNew (() => {
14 if (!mre_l
.WaitOne (3000))
15 throw new ApplicationException ("3");
18 }).ConfigureAwait (false);
30 Func
<Task
> ff
= async () =>
31 await Task
.Factory
.StartNew (() => {
32 if (!mre_l
.WaitOne (3000))
33 throw new ApplicationException ("3");
34 }).ConfigureAwait (false);
41 Func
<short, Task
<short>> f2
= async l
=> l
;
49 Action a
= async () => await Task
.Factory
.StartNew (() => {
50 if (!mre_l
.WaitOne (3000))
51 throw new ApplicationException ("4");
53 }, CancellationToken
.None
).ConfigureAwait (false);
57 if (!mre
.WaitOne (3000))
60 Console
.WriteLine ("ok");