From fd380127f004ded84d0930ee392a6498b723bcd3 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Wed, 28 Jun 2023 22:20:19 +0200 Subject: [PATCH] Codechange: use SignalObjectAndWait since we do not support older than Windows XP anymore --- src/sound/win32_s.cpp | 3 +-- src/video/dedicated_v.cpp | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sound/win32_s.cpp b/src/sound/win32_s.cpp index 87959e5860..f9fda5a349 100644 --- a/src/sound/win32_s.cpp +++ b/src/sound/win32_s.cpp @@ -98,8 +98,7 @@ void SoundDriver_Win32::Stop() /* Stop the sound thread. */ _waveout = nullptr; - SetEvent(_event); - WaitForSingleObject(_thread, INFINITE); + SignalObjectAndWait(_event, _thread, INFINITE, FALSE); /* Close the sound device. */ waveOutReset(waveout); diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index 4b492c7019..c17424874c 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -64,10 +64,8 @@ static void WINAPI CheckForConsoleInput() if (nb >= lengthof(_win_console_thread_buffer)) nb = lengthof(_win_console_thread_buffer) - 1; _win_console_thread_buffer[nb] = '\0'; - /* Signal input waiting that input is read and wait for it being handled - * SignalObjectAndWait() should be used here, but it's unsupported in Win98< */ - SetEvent(_hInputReady); - WaitForSingleObject(_hWaitForInputHandling, INFINITE); + /* Signal input waiting that input is read and wait for it being handled. */ + SignalObjectAndWait(_hInputReady, _hWaitForInputHandling, INFINITE, FALSE); } }