public bool Execute() { lock (ExecuteLock) { if (IsExecuting) { return(false); } IsExecuting = true; } Work = new Thread(delegate() { Translator.ExecuteSubroutine(this, EntryPoint); Memory.RemoveMonitor(ThreadId); WorkFinished?.Invoke(this, EventArgs.Empty); }); Work.Priority = Priority; Work.Start(); return(true); }
public void Execute(long EntryPoint) { Work = new Thread(delegate() { Translator.ExecuteSubroutine(EntryPoint); Memory.RemoveMonitor(ThreadId); WorkFinished?.Invoke(this, EventArgs.Empty); }); if (Priority < 12) { Work.Priority = ThreadPriority.Highest; } else if (Priority < 24) { Work.Priority = ThreadPriority.AboveNormal; } else if (Priority < 36) { Work.Priority = ThreadPriority.Normal; } else if (Priority < 48) { Work.Priority = ThreadPriority.BelowNormal; } else { Work.Priority = ThreadPriority.Lowest; } Work.Start(); }
public bool Execute() { if (Interlocked.Exchange(ref IsExecuting, 1) == 1) { return(false); } Work = new Thread(delegate() { Translator.ExecuteSubroutine(this, EntryPoint); Memory.RemoveMonitor(ThreadState); WorkFinished?.Invoke(this, EventArgs.Empty); }); Work.Start(); return(true); }
public AThread(ATranslator Translator, AMemory Memory, long EntryPoint) { this.Translator = Translator; this.Memory = Memory; ThreadState = new AThreadState(); ThreadState.ExecutionMode = AExecutionMode.AArch64; ThreadState.Running = true; Work = new Thread(delegate() { Translator.ExecuteSubroutine(this, EntryPoint); Memory.RemoveMonitor(ThreadState.Core); WorkFinished?.Invoke(this, EventArgs.Empty); }); }