[vlc-commits] variables: vector mutex locking

Rémi Denis-Courmont git at videolan.org
Sat May 23 16:09:16 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May 23 17:08:46 2015 +0300| [7e1ef2bed1a9427940a2314b192f783779338750] | committer: Rémi Denis-Courmont

variables: vector mutex locking

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

 src/misc/variables.c |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/src/misc/variables.c b/src/misc/variables.c
index 8120fd7..5f25f8e 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -157,7 +157,7 @@ static variable_t *Lookup( vlc_object_t *obj, const char *psz_name )
     vlc_object_internals_t *priv = vlc_internals( obj );
     variable_t **pp_var;
 
-    vlc_assert_locked( &priv->var_lock );
+    vlc_mutex_lock(&priv->var_lock);
     pp_var = tfind( &psz_name, &priv->var_root, varcmp );
     return (pp_var != NULL) ? *pp_var : NULL;
 }
@@ -436,8 +436,6 @@ int var_Destroy( vlc_object_t *p_this, const char *psz_name )
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {
@@ -493,8 +491,6 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {
@@ -716,7 +712,6 @@ int var_GetAndSet( vlc_object_t *p_this, const char *psz_name, int i_action,
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {
@@ -784,8 +779,6 @@ int var_Type( vlc_object_t *p_this, const char *psz_name )
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var != NULL )
     {
@@ -809,8 +802,6 @@ int var_SetChecked( vlc_object_t *p_this, const char *psz_name,
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {
@@ -869,8 +860,6 @@ int var_GetChecked( vlc_object_t *p_this, const char *psz_name,
     variable_t *p_var;
     int err = VLC_SUCCESS;
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var != NULL )
     {
@@ -914,8 +903,6 @@ static int AddCallback( vlc_object_t *p_this, const char *psz_name,
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {
@@ -982,8 +969,6 @@ static int DelCallback( vlc_object_t *p_this, const char *psz_name,
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {
@@ -1063,8 +1048,6 @@ int var_TriggerCallback( vlc_object_t *p_this, const char *psz_name )
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-    vlc_mutex_lock( &p_priv->var_lock );
-
     p_var = Lookup( p_this, psz_name );
     if( p_var == NULL )
     {



More information about the vlc-commits mailing list