From 9c4277ae9bee5151fff0da80bafc021cb2b9707d Mon Sep 17 00:00:00 2001 From: Anthony Miles Date: Fri, 19 Jul 2019 18:41:00 +1200 Subject: [PATCH] Avoid tight loop in DirectSound thread worker --- src/core/hle/DSOUND/DirectSound/DirectSound.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/hle/DSOUND/DirectSound/DirectSound.cpp b/src/core/hle/DSOUND/DirectSound/DirectSound.cpp index 6b6aa5187..a2c134e55 100644 --- a/src/core/hle/DSOUND/DirectSound/DirectSound.cpp +++ b/src/core/hle/DSOUND/DirectSound/DirectSound.cpp @@ -525,9 +525,10 @@ static void dsound_thread_worker(LPVOID nullPtr) { SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); - while (true) { - Sleep(0); - DSoundMutexGuardLock; + while (true) { + Sleep(1); + + DSoundMutexGuardLock; vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) {