Rémi Bernon : dinput: Wait for the internal thread with a timeout.

Alexandre Julliard julliard at winehq.org
Thu Jan 6 18:34:09 CST 2022


Module: wine
Branch: master
Commit: 7e5eeecdfb5c90042945d9e84a3a9f8b2ed0036a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7e5eeecdfb5c90042945d9e84a3a9f8b2ed0036a

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Jan  6 10:51:47 2022 +0100

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/dinput_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index a62d4d2ea3d..8347e3aa586 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -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 );
 }
 




More information about the wine-cvs mailing list