internal Coroutine(String Name, CoroutinePool Pool, Action Action)
{
this.Pool = Pool;
IsAlive = true;
Thread = new Thread(() =>
{
Console.WriteLine("Coroutine.Start()");
try
{
CoroutineContinueEvent_WaitOne();
Action();
}
catch (InterruptException)
{
}
catch (Exception Exception)
{
RethrowException = Exception;
}
finally
{
Console.WriteLine("Coroutine.End()");
IsAlive = false;
Pool.CallerContinueEvent.Set();
}
})
{
CurrentCulture = new CultureInfo("en-US"),
IsBackground = true,
};
this.Name = Name;
this.MustStart = true;
}