From: RĂ©mi Duraffort Date: Sat, 3 Apr 2010 16:50:57 +0000 (+0200) Subject: Lua_ext: fix race condition. X-Git-Tag: 1.1.0-pre1~134 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c12e97cbe7f2b58bd5d4f5c4c45485d59de6f315;p=vlc Lua_ext: fix race condition. --- diff --git a/modules/misc/lua/extension_thread.c b/modules/misc/lua/extension_thread.c index 024949def8..397ddf9588 100644 --- a/modules/misc/lua/extension_thread.c +++ b/modules/misc/lua/extension_thread.c @@ -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 );