예제 #1
0
        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);
        }
예제 #2
0
        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();
        }
예제 #3
0
파일: AThread.cs 프로젝트: cin619/Ryujinx
        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);
        }
예제 #4
0
        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);
            });
        }