Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MicroThreadYieldAwaiter.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Runtime.CompilerServices;
5 
6 namespace SiliconStudio.Core.MicroThreading
7 {
9  {
10  private MicroThread microThread;
11 
13  {
14  this.microThread = microThread;
15  }
16 
18  {
19  return this;
20  }
21 
22  public bool IsCompleted
23  {
24  get
25  {
26  lock (microThread.Scheduler.scheduledMicroThreads)
27  {
28  return microThread.Scheduler.scheduledMicroThreads.Count == 0;
29  }
30  }
31  }
32 
33  public void GetResult()
34  {
35  // Check Task Result (exception, etc...)
36  }
37 
38  public void OnCompleted(Action continuation)
39  {
40  microThread.ScheduleContinuation(ScheduleMode.Last, continuation);
41  }
42  }
43 }
Represents an execution context managed by a Scheduler, that can cooperatively yield execution to ano...
Definition: MicroThread.cs:16