internal Coroutine(String Name, CoroutinePool Pool, Action Action) { this.Pool = Pool; IsAlive = true; Thread = new Thread(() => { try { CoroutineContinueEvent_WaitOne(); Action(); } catch (InterruptException) { } catch (Exception Exception) { RethrowException = Exception; } finally { IsAlive = false; Pool.CallerContinueEvent.Set(); } }) { CurrentCulture = new CultureInfo("en-US"), IsBackground = true, }; this.Name = Name; this.MustStart = true; }
internal Coroutine(string name, CoroutinePool pool, Action action) { Pool = pool; IsAlive = true; Thread = new Thread(() => { Console.WriteLine("Coroutine.Start()"); try { CoroutineContinueEvent_WaitOne(); action(); } catch (InterruptException) { } catch (Exception e) { _rethrowException = e; } finally { Console.WriteLine("Coroutine.End()"); IsAlive = false; pool.CallerContinueEvent.Set(); } }) { CurrentCulture = new CultureInfo("en-US"), IsBackground = true, }; Name = name; _mustStart = true; }
internal Coroutine(String Name, CoroutinePool Pool, Action Action) { this.Pool = Pool; IsAlive = true; Thread = new Thread(() => { try { CoroutineContinueEvent_WaitOne(); Action(); } catch (InterruptException) { } catch (Exception Exception) { RethrowException = Exception; } finally { IsAlive = false; Pool.CallerContinueEvent.Set(); } }) { CurrentCulture = new CultureInfo("en-US"), IsBackground = true, }; this.Name = Name; this.MustStart = true; }
public override void InitializeComponent() { this.PspConfig = PspEmulatorContext.PspConfig; if (this.PspConfig.UseCoRoutines) { this.CoroutinePool = new CoroutinePool(); } else { } Reset(); }
public override void InitializeComponent() { this.PspConfig = PspEmulatorContext.PspConfig; if (this.PspConfig.UseCoRoutines) { this.CoroutinePool = new CoroutinePool(); } else { } NativeBreakpoints = new HashSet<uint>(); RegisteredNativeSyscalls = new Dictionary<int, Action<CpuThreadState, int>>(); IsRunning = true; }