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

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


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

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

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit 09cc30dff2dfca9ec993c7bf245942ca5735ebf0)

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

 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 8e5a162..c8d6611 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