mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #4153 from unknownbrackets/shutdown
The shutdown adjustments keep coming
This commit is contained in:
commit
03766f562f
3 changed files with 8 additions and 7 deletions
|
@ -435,9 +435,9 @@ void __IoManagerThread() {
|
|||
}
|
||||
|
||||
void __IoWakeManager() {
|
||||
// Ping the thread so that it knows to check coreState.
|
||||
ioManagerThreadEnabled = false;
|
||||
ioManager.FinishEventLoop();
|
||||
ioManager.SyncThread();
|
||||
}
|
||||
|
||||
void __IoInit() {
|
||||
|
|
|
@ -269,13 +269,10 @@ void Core_UpdateState(CoreState newState) {
|
|||
}
|
||||
|
||||
void System_Wake() {
|
||||
if (CPU_IsReady()) {
|
||||
CPU_NextStateNot(CPU_THREAD_NOT_RUNNING, CPU_THREAD_SHUTDOWN);
|
||||
CPU_WaitStatus(cpuThreadReplyCond, &CPU_IsShutdown);
|
||||
}
|
||||
// Ping the threads so they check coreState.
|
||||
CPU_NextStateNot(CPU_THREAD_NOT_RUNNING, CPU_THREAD_SHUTDOWN);
|
||||
if (gpu) {
|
||||
gpu->FinishEventLoop();
|
||||
gpu->SyncThread();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace DSound
|
|||
|
||||
CRITICAL_SECTION soundCriticalSection;
|
||||
HANDLE soundSyncEvent = NULL;
|
||||
HANDLE hThread;
|
||||
HANDLE hThread = NULL;
|
||||
|
||||
StreamCallback callback;
|
||||
|
||||
|
@ -195,6 +195,8 @@ namespace DSound
|
|||
if (!dsBuffer)
|
||||
return;
|
||||
|
||||
EnterCriticalSection(&soundCriticalSection);
|
||||
|
||||
if (threadData == 0)
|
||||
threadData = 1;
|
||||
|
||||
|
@ -202,6 +204,7 @@ namespace DSound
|
|||
{
|
||||
WaitForSingleObject(hThread, 1000);
|
||||
CloseHandle(hThread);
|
||||
hThread = NULL;
|
||||
}
|
||||
|
||||
if (threadData == 2)
|
||||
|
@ -217,6 +220,7 @@ namespace DSound
|
|||
if (soundSyncEvent != NULL)
|
||||
CloseHandle(soundSyncEvent);
|
||||
soundSyncEvent = NULL;
|
||||
LeaveCriticalSection(&soundCriticalSection);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue