Commit c12e97cb authored by Rémi Duraffort's avatar Rémi Duraffort

Lua_ext: fix race condition.

parent b5d68b65
...@@ -392,6 +392,7 @@ static void* Run( void *data ) ...@@ -392,6 +392,7 @@ static void* Run( void *data )
} }
} }
vlc_mutex_lock( &p_ext->p_sys->command_lock );
if( cmd ) if( cmd )
{ {
p_ext->p_sys->command = cmd->next; p_ext->p_sys->command = cmd->next;
...@@ -399,7 +400,6 @@ static void* Run( void *data ) ...@@ -399,7 +400,6 @@ static void* Run( void *data )
FreeCommands( cmd ); FreeCommands( cmd );
} }
vlc_mutex_lock( &p_ext->p_sys->command_lock );
if( !p_ext->p_sys->b_exiting && !p_ext->p_sys->command ) 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 ); vlc_cond_wait( &p_ext->p_sys->wait, &p_ext->p_sys->command_lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment