[vlc-commits] commit: Win32: simplify vlc_cancel() ( =?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Mon Nov 29 19:27:35 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 23 23:07:05 2010 +0200| [2ebdd8c3540d6ff5a48cebf8037120edfb7219f8] | committer: Rémi Denis-Courmont 

Win32: simplify vlc_cancel()

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

 src/win32/thread.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/win32/thread.c b/src/win32/thread.c
index d2018d5..0c42284 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -79,7 +79,7 @@ static DWORD vlc_cancelable_wait (DWORD count, const HANDLE *handles,
                                            delay);
     if (result == WAIT_OBJECT_0 + count)
     {
-        vlc_cancel_self (NULL);
+        vlc_cancel_self ((uintptr_t)th);
         return WAIT_IO_COMPLETION;
     }
     else
@@ -645,20 +645,18 @@ int vlc_clone_detach (vlc_thread_t *p_handle, void *(*entry) (void *),
 /*** Thread cancellation ***/
 
 /* APC procedure for thread cancellation */
-static void CALLBACK vlc_cancel_self (ULONG_PTR dummy)
+static void CALLBACK vlc_cancel_self (ULONG_PTR self)
 {
-    struct vlc_thread *th = vlc_threadvar_get (thread_key);
+    struct vlc_thread *th = (void *)self;
 
     if (likely(th != NULL))
         th->killed = true;
-
-    (void)dummy;
 }
 
 void vlc_cancel (vlc_thread_t th)
 {
 #ifndef UNDER_CE
-    QueueUserAPC (vlc_cancel_self, th->id, 0);
+    QueueUserAPC (vlc_cancel_self, th->id, (uintptr_t)th);
 #else
     SetEvent (th->cancel_event);
 #endif



More information about the vlc-commits mailing list