Avoid tight loop in DirectSound thread worker

This commit is contained in:
Anthony Miles 2019-07-19 18:41:00 +12:00
parent 1edbc208e5
commit 9c4277ae9b
1 changed files with 4 additions and 3 deletions

View File

@ -525,9 +525,10 @@ static void dsound_thread_worker(LPVOID nullPtr)
{ {
SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers);
while (true) { while (true) {
Sleep(0); Sleep(1);
DSoundMutexGuardLock;
DSoundMutexGuardLock;
vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin();
for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) { for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) {