]> git.sesse.net Git - vlc/commitdiff
Win32: inline vlc_cancel_self
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 7 Apr 2010 18:55:17 +0000 (21:55 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 7 Apr 2010 18:55:17 +0000 (21:55 +0300)
include/vlc_threads.h
src/win32/thread.c

index 8bff2382d65b3e6b8b1b5897ae4c818c41ddabb5..3caa97d5fe6dd0526172eca9cda16c33eac532f5 100644 (file)
@@ -206,7 +206,6 @@ VLC_EXPORT( unsigned, vlc_timer_getoverrun, (vlc_timer_t) LIBVLC_USED );
 
 #ifndef LIBVLC_USE_PTHREAD_CANCEL
 enum {
-    VLC_DO_CANCEL,
     VLC_CLEANUP_PUSH,
     VLC_CLEANUP_POP,
 };
index 7c0909d1b7e4a6db81df322dc1f1014aeabc9d6e..c41fbc443a0df628dbd008fc9b5f1ddaa4a25c5f 100644 (file)
@@ -636,8 +636,12 @@ void vlc_detach (vlc_thread_t handle)
 /* APC procedure for thread cancellation */
 static void CALLBACK vlc_cancel_self (ULONG_PTR dummy)
 {
+    vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
+
+    if (likely(nfo != NULL))
+        nfo->killed = true;
+
     (void)dummy;
-    vlc_control_cancel (VLC_DO_CANCEL);
 }
 
 void vlc_cancel (vlc_thread_t thread_id)
@@ -705,10 +709,6 @@ void vlc_control_cancel (int cmd, ...)
     va_start (ap, cmd);
     switch (cmd)
     {
-        case VLC_DO_CANCEL:
-            nfo->killed = true;
-            break;
-
         case VLC_CLEANUP_PUSH:
         {
             /* cleaner is a pointer to the caller stack, no need to allocate