dinput: Wait for the internal thread with a timeout.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52263
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-01-06 10:51:47 +01:00 committed by Alexandre Julliard
parent 575e632d08
commit 7e5eeecdfb

View file

@ -1379,7 +1379,8 @@ static void dinput_thread_start(void)
static void dinput_thread_stop(void)
{
PostThreadMessageW( dinput_thread_id, WM_USER + 0x10, 0, 0 );
WaitForSingleObject( dinput_thread, INFINITE );
if (WaitForSingleObject( dinput_thread, 500 ) == WAIT_TIMEOUT)
WARN("Timeout while waiting for internal thread\n");
CloseHandle( dinput_thread );
}