X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.Runtime.CompilerServices%2FTaskAwaiter.cs;h=80b64cb56e841ac167288eb742725eca27a91d6b;hb=3fb128ac0de7cca459098c2dc3359d81f5e48353;hp=b6998479cc3fbbb11bd2d28048edc8f5100a002c;hpb=e94da6da6c5c4cb8a09c13cc71c654fb1dfb3fba;p=mono.git diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs b/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs index b6998479cc3..80b64cb56e8 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs @@ -83,13 +83,13 @@ namespace System.Runtime.CompilerServices } else { IContinuation cont; Task cont_task; - if (continueOnSourceContext && TaskScheduler.Current != TaskScheduler.Default) { + if (continueOnSourceContext && !TaskScheduler.IsDefault) { cont_task = new Task (TaskActionInvoker.Create (continuation), null, CancellationToken.None, TaskCreationOptions.None, null); cont_task.SetupScheduler (TaskScheduler.Current); cont = new SchedulerAwaitContinuation (cont_task); } else { cont_task = null; - cont = new ActionContinuation (continuation); + cont = new AwaiterActionContinuation (continuation); } // @@ -104,7 +104,7 @@ namespace System.Runtime.CompilerServices cont_task.SetupScheduler (TaskScheduler.Current); } - cont_task.Schedule (); + cont_task.Schedule (true); } }