aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/CpuThread.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ChocolArm64/CpuThread.cs')
-rw-r--r--ChocolArm64/CpuThread.cs66
1 files changed, 0 insertions, 66 deletions
diff --git a/ChocolArm64/CpuThread.cs b/ChocolArm64/CpuThread.cs
deleted file mode 100644
index ad1fd6f3..00000000
--- a/ChocolArm64/CpuThread.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using ChocolArm64.Memory;
-using ChocolArm64.State;
-using ChocolArm64.Translation;
-using System;
-using System.Threading;
-
-namespace ChocolArm64
-{
- public class CpuThread
- {
- public CpuThreadState ThreadState { get; private set; }
- public MemoryManager Memory { get; private set; }
-
- private Translator _translator;
-
- public Thread Work;
-
- public event EventHandler WorkFinished;
-
- private int _isExecuting;
-
- public CpuThread(Translator translator, MemoryManager memory, long entrypoint)
- {
- _translator = translator;
- Memory = memory;
-
- ThreadState = new CpuThreadState();
-
- ThreadState.Running = true;
-
- Work = new Thread(delegate()
- {
- translator.ExecuteSubroutine(this, entrypoint);
-
- WorkFinished?.Invoke(this, EventArgs.Empty);
- });
- }
-
- public bool Execute()
- {
- if (Interlocked.Exchange(ref _isExecuting, 1) == 1)
- {
- return false;
- }
-
- Work.Start();
-
- return true;
- }
-
- public void StopExecution()
- {
- ThreadState.Running = false;
- }
-
- public void RequestInterrupt()
- {
- ThreadState.RequestInterrupt();
- }
-
- public bool IsCurrentThread()
- {
- return Thread.CurrentThread == Work;
- }
- }
-} \ No newline at end of file