[vlc-devel] [PATCH 1/2] thread: winstore: Do not discard a signaled object.

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Nov 20 14:36:12 CET 2014


When a thread is cancelled yet not killable, discarding a WAIT_OBJECT_X would cause the thread to wait forever, since vlc_testcancel would not abort the thread.
---
 src/win32/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/win32/thread.c b/src/win32/thread.c
index fe17ad5..1cb2ee0 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -81,7 +81,7 @@ static DWORD vlc_WaitForMultipleObjects (DWORD count, const HANDLE *handles,
             ret = WaitForMultipleObjectsEx (count, handles, FALSE, new_delay, TRUE);
             if (delay != INFINITE)
                 delay -= new_delay;
-            if (isCancelled())
+            if (ret == WAIT_TIMEOUT && isCancelled())
                 ret = WAIT_IO_COMPLETION;
         } while (delay && ret == WAIT_TIMEOUT);
 #else
-- 
1.8.5.2 (Apple Git-48)




More information about the vlc-devel mailing list