aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/citra_qt/bootmanager.h
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-04-28 19:03:01 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-05-01 18:27:07 -0400
commite4ea133717a5292339c134160da984ba186d3de8 (patch)
treef6c3e289eaee3c79375d136279509523d4b3aca8 /src/citra_qt/bootmanager.h
parent3dd268878570c2c48e2be4018ff4d0ea851ece60 (diff)
Qt: Restructured to remove unnecessary shutdown event and various cleanups.
Diffstat (limited to 'src/citra_qt/bootmanager.h')
-rw-r--r--src/citra_qt/bootmanager.h44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h
index f6f09773..e9b3ea66 100644
--- a/src/citra_qt/bootmanager.h
+++ b/src/citra_qt/bootmanager.h
@@ -25,66 +25,46 @@ public:
/**
* Start emulation (on new thread)
- *
* @warning Only call when not running!
*/
void run() override;
/**
- * Allow the CPU to process a single instruction (if cpu is not running)
- *
+ * Steps the emulation thread by a single CPU instruction (if the CPU is not already running)
* @note This function is thread-safe
*/
- void ExecStep() { exec_cpu_step = true; }
+ void ExecStep() { exec_step = true; }
/**
- * Sets whether the CPU is running
- *
+ * Sets whether the emulation thread is running or not
+ * @param running Boolean value, set the emulation thread to running if true
* @note This function is thread-safe
*/
- void SetCpuRunning(bool running) { cpu_running = running; }
+ void SetRunning(bool running) { this->running = running; }
/**
- * Allow the CPU to continue processing instructions without interruption
- *
+ * Check if the emulation thread is running or not
+ * @return True if the emulation thread is running, otherwise false
* @note This function is thread-safe
*/
- bool IsCpuRunning() { return cpu_running; }
-
-
- /**
- * Shutdown (permantently stops) the CPU
- */
- void ShutdownCpu() { stop_run = true; };
+ bool IsRunning() { return running; }
/**
- * Waits for the CPU shutdown to complete
+ * Shutdown (permanently stops) the emulation thread
*/
- void WaitForCpuShutdown() { shutdown_event.Wait(); }
-
-
-public slots:
- /**
- * Stop emulation and wait for the thread to finish.
- *
- * @details: This function will wait a second for the thread to finish; if it hasn't finished until then, we'll terminate() it and wait another second, hoping that it will be terminated by then.
- * @note: This function is thread-safe.
- */
- void Stop();
+ void Shutdown() { stop_run = true; };
private:
friend class GMainWindow;
EmuThread(GRenderWindow* render_window);
- bool exec_cpu_step;
- bool cpu_running;
+ bool exec_step;
+ bool running;
std::atomic<bool> stop_run;
GRenderWindow* render_window;
- Common::Event shutdown_event;
-
signals:
/**
* Emitted when the CPU has halted execution