From b0e6967697dfd98feb995c20840bcb507cb37cd1 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 8 Aug 2013 01:09:43 -0700 Subject: [PATCH] Rename UseCPUThread to SeparateCPUThread. --- Core/Config.cpp | 4 ++-- Core/Config.h | 2 +- Core/System.cpp | 9 ++++----- GPU/GPUCommon.cpp | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 537757169e..628be9b1cc 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -89,7 +89,7 @@ void Config::Load(const char *iniFileName) #else cpu->Get("Jit", &bJit, true); #endif - cpu->Get("UseCPUThread", &bUseCPUThread, false); + cpu->Get("SeparateCPUThread", &bSeparateCPUThread, false); cpu->Get("FastMemory", &bFastMemory, false); cpu->Get("CPUSpeed", &iLockedCPUSpeed, false); @@ -227,7 +227,7 @@ void Config::Save() IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU"); cpu->Set("Jit", bJit); - cpu->Set("UseCPUThread", bUseCPUThread); + cpu->Set("SeparateCPUThread", bSeparateCPUThread); cpu->Set("FastMemory", bFastMemory); cpu->Set("CPUSpeed", iLockedCPUSpeed); diff --git a/Core/Config.h b/Core/Config.h index 1888e673c5..042dc6786b 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -57,7 +57,7 @@ public: bool bFastMemory; bool bJit; // Definitely cannot be changed while game is running. - bool bUseCPUThread; + bool bSeparateCPUThread; int iLockedCPUSpeed; bool bAutoSaveSymbolMap; std::string sReportHost; diff --git a/Core/System.cpp b/Core/System.cpp index dd4a8e573a..b0db7358b1 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -210,8 +210,7 @@ void CPU_RunLoop() { default: ERROR_LOG(CPU, "CPU thread in unexpected state: %d", cpuThreadState); // Begin shutdown, otherwise we'd just spin on this bad state. - cpuThreadState = CPU_THREAD_SHUTDOWN; - cpuThreadCond.notify_all(); + CPU_SetState(CPU_THREAD_SHUTDOWN); break; } } @@ -236,7 +235,7 @@ bool PSP_Init(const CoreParameter &coreParam, std::string *error_string) { coreParameter = coreParam; coreParameter.errorString = ""; - if (g_Config.bUseCPUThread) { + if (g_Config.bSeparateCPUThread) { CPU_SetState(CPU_THREAD_PENDING); cpuThread = new std::thread(&CPU_RunLoop); CPU_WaitStatus(&CPU_IsReady); @@ -259,7 +258,7 @@ bool PSP_IsInited() { void PSP_Shutdown() { if (coreState == CORE_RUNNING) coreState = CORE_ERROR; - if (g_Config.bUseCPUThread) { + if (g_Config.bSeparateCPUThread) { CPU_SetState(CPU_THREAD_SHUTDOWN); CPU_WaitStatus(&CPU_IsShutdown); } else { @@ -271,7 +270,7 @@ void PSP_Shutdown() { void PSP_RunLoopUntil(u64 globalticks) { SaveState::Process(); - if (g_Config.bUseCPUThread) { + if (g_Config.bSeparateCPUThread) { cpuThreadUntil = globalticks; if (CPU_NextState(CPU_THREAD_RUNNING, CPU_THREAD_EXECUTE)) { // The CPU doesn't actually respect cpuThreadUntil well, especially when skipping frames. diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index fdc4339f80..9fd2314a86 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -549,7 +549,7 @@ void GPUCommon::ScheduleEvent(GPUEvent ev) { events.push_back(ev); eventsCond.notify_one(); - if (!g_Config.bUseCPUThread) { + if (!g_Config.bSeparateCPUThread) { RunEventsUntil(0); } } @@ -577,7 +577,7 @@ void GPUCommon::RunEventsUntil(u64 globalticks) { } // coreState changes won't wake us, so recheck periodically. - if (!g_Config.bUseCPUThread) { + if (!g_Config.bSeparateCPUThread) { return; } eventsCond.wait_for(eventsLock, 1); @@ -585,7 +585,7 @@ void GPUCommon::RunEventsUntil(u64 globalticks) { } void GPUCommon::SyncThread() { - if (!g_Config.bUseCPUThread) { + if (!g_Config.bSeparateCPUThread) { return; }