[vlc-commits] commit: Win32: inline vlc_cancel_self ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Wed Apr 7 21:10:55 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr  7 21:55:17 2010 +0300| [e7b765a18256d7c2e1cbaa9573ab28e26c99a0f5] | committer: Rémi Denis-Courmont 

Win32: inline vlc_cancel_self

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

 include/vlc_threads.h |    1 -
 src/win32/thread.c    |   10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 8bff238..3caa97d 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -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,
 };
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 7c0909d..c41fbc4 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -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



More information about the vlc-commits mailing list