]> git.sesse.net Git - vlc/commitdiff
Fix the problem that mwait() and msleep() do not work in a main thread and an alien...
authorKO Myung-Hun <komh@chollian.net>
Sat, 22 Oct 2011 06:28:01 +0000 (15:28 +0900)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 22 Oct 2011 16:11:44 +0000 (18:11 +0200)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
src/os2/thread.c

index 41b68d44d21357da0a847456b770a58efc51f007..197ca0113347bb6ad15e020fe2f30b29aee37129 100644 (file)
@@ -72,8 +72,13 @@ static ULONG vlc_DosWaitEventSemEx( HEV hev, ULONG ulTimeout, BOOL fCancelable )
     struct vlc_thread *th = vlc_threadvar_get( thread_key );
     if( th == NULL || !fCancelable )
     {
-        /* Main thread - cannot be cancelled anyway */
-        return DosWaitEventSem( hev, ulTimeout );
+        /* Main thread - cannot be cancelled anyway
+         * Alien thread - out of our control
+         */
+        if( hev != NULLHANDLE )
+            return DosWaitEventSem( hev, ulTimeout );
+
+        return DosSleep( ulTimeout );
     }
 
     n = 0;