[vlc-commits] commit: Lua_ext: fix race condition. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Sat Apr 3 19:17:45 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Apr  3 18:50:57 2010 +0200| [c12e97cbe7f2b58bd5d4f5c4c45485d59de6f315] | committer: Rémi Duraffort 

Lua_ext: fix race condition.

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

 modules/misc/lua/extension_thread.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/misc/lua/extension_thread.c b/modules/misc/lua/extension_thread.c
index 024949d..397ddf9 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 );



More information about the vlc-commits mailing list