[vlc-commits] Reduce interface lock scope

Rémi Denis-Courmont git at videolan.org
Fri Aug 19 23:00:15 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 19 23:28:47 2011 +0300| [2068f9bce092c79a4e927daf7999c293955d4b5b] | committer: Rémi Denis-Courmont

Reduce interface lock scope

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

 src/interface/interface.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/interface/interface.c b/src/interface/interface.c
index c87cf30..0b3794f 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -129,7 +129,6 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
         goto error;
     }
 
-    vlc_mutex_lock( &lock );
 #if defined( __APPLE__ )
     /* Hack to get Mac OS X Cocoa runtime running
      * (it needs access to the main thread) */
@@ -139,7 +138,6 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
                        MonitorLibVLCDeath, p_intf, VLC_THREAD_PRIORITY_LOW ) )
         {
             msg_Err( p_intf, "cannot spawn libvlc death monitoring thread" );
-            vlc_mutex_unlock( &lock );
             goto error;
         }
         assert( p_intf->pf_run );
@@ -158,10 +156,10 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
                    RunInterface, p_intf, VLC_THREAD_PRIORITY_LOW ) )
     {
         msg_Err( p_intf, "cannot spawn interface thread" );
-        vlc_mutex_unlock( &lock );
         goto error;
     }
 
+    vlc_mutex_lock( &lock );
     p_intf->p_next = libvlc_priv( p_libvlc )->p_intf;
     libvlc_priv( p_libvlc )->p_intf = p_intf;
     vlc_mutex_unlock( &lock );



More information about the vlc-commits mailing list