[vlc-commits] win32: remove cancellation polling code

Rémi Denis-Courmont git at videolan.org
Wed Jun 1 22:49:54 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun  1 23:48:09 2016 +0300| [7fdf83a7bb4492f37938ad9ba98860599d1f84d6] | committer: Rémi Denis-Courmont

win32: remove cancellation polling code

There is currently no need for cancellation in vlc_join(), which is
the only remain use case. If this ever came to be necessary, using a
semaphore would be more suitable.

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

 src/win32/thread.c |   31 +------------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/src/win32/thread.c b/src/win32/thread.c
index 9efd45c..df89fdf 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -67,27 +67,9 @@ struct vlc_thread
 };
 
 /*** Common helpers ***/
-#if !IS_INTERRUPTIBLE
-static bool isCancelled(void);
-#endif
-
 static DWORD vlc_WaitForSingleObject(HANDLE handle, DWORD delay)
 {
-    DWORD ret;
-#if !IS_INTERRUPTIBLE
-        do {
-            DWORD new_delay = 50;
-            if (new_delay > delay)
-                new_delay = delay;
-            ret = WaitForSingleObjectEx(handle, new_delay, TRUE);
-            if (delay != INFINITE)
-                delay -= new_delay;
-            if (isCancelled())
-                ret = WAIT_IO_COMPLETION;
-        } while (delay && ret == WAIT_TIMEOUT);
-#else
-    ret = WaitForSingleObjectEx(handle, delay, TRUE);
-#endif
+    DWORD ret = WaitForSingleObjectEx(handle, delay, TRUE);
 
     /* We do not abandon objects... this would be a bug */
     assert(ret != WAIT_ABANDONED_0);
@@ -472,17 +454,6 @@ void vlc_addr_broadcast(void *addr)
 }
 
 /*** Threads ***/
-#if !IS_INTERRUPTIBLE
-static bool isCancelled(void)
-{
-    struct vlc_thread *th = vlc_thread_self();
-    if (th == NULL)
-        return false; /* Main thread - cannot be cancelled anyway */
-
-    return atomic_load(&th->killed);
-}
-#endif
-
 static void vlc_thread_destroy(vlc_thread_t th)
 {
     DeleteCriticalSection(&th->wait.lock);



More information about the vlc-commits mailing list