[vlc-devel] commit: Config lock is pointless while reading/resetting the configuration ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 6 19:27:13 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May  6 20:22:16 2009 +0300| [2085be2a22d36cf341e7fc8d2407233d6bf75a7a] | committer: Rémi Denis-Courmont 

Config lock is pointless while reading/resetting the configuration

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

 src/config/core.c |    7 -------
 src/config/file.c |    9 ---------
 2 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/src/config/core.c b/src/config/core.c
index 6e88b99..721c2b5 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -26,7 +26,6 @@
 #endif
 
 #include <vlc_common.h>
-#include "../libvlc.h"
 #include "vlc_keys.h"
 #include "vlc_charset.h"
 #include "vlc_configuration.h"
@@ -534,14 +533,9 @@ void config_UnsetCallbacks( module_config_t *p_new, size_t n )
  *****************************************************************************/
 void __config_ResetAll( vlc_object_t *p_this )
 {
-    libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
     module_t *p_module;
     module_t **list = module_list_get (NULL);
 
-    /* Acquire config file lock */
-    vlc_mutex_lock( &priv->config_lock );
-
-
     for (size_t j = 0; (p_module = list[j]) != NULL; j++)
     {
         if( p_module->b_submodule ) continue;
@@ -568,5 +562,4 @@ void __config_ResetAll( vlc_object_t *p_this )
     }
 
     module_list_free (list);
-    vlc_mutex_unlock( &priv->config_lock );
 }
diff --git a/src/config/file.c b/src/config/file.c
index a01dc3c..4012ea2 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -152,16 +152,12 @@ static int strtoi (const char *str)
  *****************************************************************************/
 int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
 {
-    libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
     FILE *file;
 
     file = config_OpenConfigFile (p_this, "rt");
     if (file == NULL)
         return VLC_EGENERIC;
 
-    /* Acquire config file lock */
-    vlc_mutex_lock( &priv->config_lock );
-
     /* Look for the selected module, if NULL then save everything */
     module_t **list = module_list_get (NULL);
 
@@ -314,8 +310,6 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
         uselocale (baseloc);
         freelocale (loc);
     }
-
-    vlc_mutex_unlock( &priv->config_lock );
     return 0;
 }
 
@@ -703,14 +697,12 @@ error:
 
 int config_AutoSaveConfigFile( vlc_object_t *p_this )
 {
-    libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
     size_t i_index;
     bool save = false;
 
     assert( p_this );
 
     /* Check if there's anything to save */
-    vlc_mutex_lock( &priv->config_lock );
     module_t **list = module_list_get (NULL);
     for( i_index = 0; list[i_index] && !save; i_index++ )
     {
@@ -729,7 +721,6 @@ int config_AutoSaveConfigFile( vlc_object_t *p_this )
         }
     }
     module_list_free (list);
-    vlc_mutex_unlock( &priv->config_lock );
 
     return save ? VLC_SUCCESS : SaveConfigFile( p_this, NULL, true );
 }




More information about the vlc-devel mailing list