2 using System
.Threading
.Tasks
;
3 using System
.Threading
;
7 ManualResetEvent mre
= new ManualResetEvent (false);
9 public async Task
TestTask ()
11 await Call ().ConfigureAwait (false);
14 public async Task
TestTask2 ()
16 await Call ().ConfigureAwait (false);
22 return Task
.Factory
.StartNew (() => {
24 Console
.WriteLine ("a");
28 public async Task
<int> TestTaskGeneric ()
30 return await CallGeneric ().ConfigureAwait (false);
33 Task
<int> CallGeneric ()
35 return Task
.Factory
.StartNew (() => {
41 public static int Main ()
44 var t
= c
.TestTask ();
45 if (t
.Status
!= TaskStatus
.WaitingForActivation
)
49 if (!Task
.WaitAll (new[] { t }
, 3000))
52 if (t
.Status
!= TaskStatus
.RanToCompletion
)
57 if (t
.Status
!= TaskStatus
.WaitingForActivation
)
61 if (!Task
.WaitAll (new[] { t }
, 3000))
64 if (t
.Status
!= TaskStatus
.RanToCompletion
)
68 var t2
= c
.TestTaskGeneric ();
69 if (t2
.Status
!= TaskStatus
.WaitingForActivation
)
73 if (!Task
.WaitAll (new[] { t2 }
, 3000))
79 if (t2
.Status
!= TaskStatus
.RanToCompletion
)