]> git.sesse.net Git - vlc/commitdiff
Lua_ext: fix race condition.
authorRémi Duraffort <ivoire@videolan.org>
Sat, 3 Apr 2010 16:50:57 +0000 (18:50 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sat, 3 Apr 2010 17:11:11 +0000 (19:11 +0200)
modules/misc/lua/extension_thread.c

index 024949def8a104d2cdf22b0b4d1b5c94ac78d00b..397ddf95889111271fd678bfed849dcbedfec63f 100644 (file)
@@ -392,6 +392,7 @@ static void* Run( void *data )
             }
         }
 
+        vlc_mutex_lock( &p_ext->p_sys->command_lock );
         if( cmd )
         {
             p_ext->p_sys->command = cmd->next;
@@ -399,7 +400,6 @@ static void* Run( void *data )
             FreeCommands( cmd );
         }
 
-        vlc_mutex_lock( &p_ext->p_sys->command_lock );
         if( !p_ext->p_sys->b_exiting && !p_ext->p_sys->command )
         {
             vlc_cond_wait( &p_ext->p_sys->wait, &p_ext->p_sys->command_lock );