]> git.sesse.net Git - vlc/commitdiff
Extensions: hopefully fix a race condition on deactivation
authorJean-Philippe André <jpeg@videolan.org>
Wed, 3 Feb 2010 14:04:17 +0000 (15:04 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Wed, 3 Feb 2010 16:14:00 +0000 (17:14 +0100)
modules/misc/lua/extension_thread.c

index ac3a4592e45fcc387d07d7654da0c8797582c11b..3b1cbd973ad8adddcbb24c5c33e65fcb543deb36 100644 (file)
@@ -199,7 +199,9 @@ static int RemoveActivated( extensions_manager_t *p_mgr, extension_t *p_ext )
 void WaitForDeactivation( extension_t *p_ext )
 {
     void *pointer = NULL;
+    vlc_mutex_lock( &p_ext->p_sys->command_lock );
     vlc_cond_signal( &p_ext->p_sys->wait );
+    vlc_mutex_unlock( &p_ext->p_sys->command_lock );
     vlc_join( p_ext->p_sys->thread, &pointer );
 }
 
@@ -383,7 +385,7 @@ static void* Run( void *data )
     }
 
     vlc_mutex_unlock( &p_ext->p_sys->command_lock );
-    msg_Dbg( p_mgr, "Extension thread ending..." );
+    msg_Dbg( p_mgr, "Extension thread end: '%s'", p_ext->psz_title );
 
     // Note: At this point, the extension should be deactivated
     return NULL;