Simplify the EmuThread API again

This commit is contained in:
Henrik Rydgård committed 2026-08-05 09:48:51 +02:00
1 parent e0c942e862
commit 16206d18ab
5 files changed
+30 -25

No files matched your search

+9 -1
View File
@@ -84,11 +84,19 @@ std::thread EmuThread_Start(GraphicsContext *graphicsContext, Application *appli
// This is useful when the render thread is in control.
void EmuThread_RequestExit() {
INFO_LOG(Log::System, "EmuTread_RequestExit");
g_emuThreadState = EmuThreadState::QUIT_REQUESTED;
if (g_emuThreadState == EmuThreadState::RUNNING) {
g_emuThreadState = EmuThreadState::QUIT_REQUESTED;
} else {
INFO_LOG(Log::System, "EmuTread_RequestExit: g_emuThreadState was not RUNNING, so not requesting exit.");
}
}
void EmuThread_Join(GraphicsContext *graphicsContext, std::thread &emuThread) {
INFO_LOG(Log::System, "EmuTread_Join");
if (graphicsContext->NeedsSeparateEmuThread()) {
EmuThread_RequestExit();
while (graphicsContext->ThreadFrame()) {}
}
emuThread.join();
emuThread = std::thread();
graphicsContext->ThreadEnd();