[vlc-commits] oldrc: fix thread-cancellation on windows (fixes #10483)

Hannes Domani git at videolan.org
Sat Aug 16 09:27:23 CEST 2014


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Fri Aug 15 22:50:48 2014 +0200| [09cc30dff2dfca9ec993c7bf245942ca5735ebf0] | committer: Rémi Denis-Courmont

oldrc: fix thread-cancellation on windows (fixes #10483)

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=09cc30dff2dfca9ec993c7bf245942ca5735ebf0
---

 modules/control/rc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index 0af8619..54a23c1 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1798,8 +1798,8 @@ static bool ReadWin32( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
     DWORD i_dw;
 
     /* On Win32, select() only works on socket descriptors */
-    while( WaitForSingleObject( p_intf->p_sys->hConsoleIn,
-                                INTF_IDLE_SLEEP/1000 ) == WAIT_OBJECT_0 )
+    while( WaitForSingleObjectEx( p_intf->p_sys->hConsoleIn,
+                                INTF_IDLE_SLEEP/1000, TRUE ) == WAIT_OBJECT_0 )
     {
         while( *pi_size < MAX_LINE_LENGTH &&
                ReadConsoleInput( p_intf->p_sys->hConsoleIn, &input_record,
@@ -1853,6 +1853,8 @@ static bool ReadWin32( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
         }
     }
 
+    vlc_testcancel ();
+
     return false;
 }
 #endif



More information about the vlc-commits mailing list