Commit 2085be2a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Config lock is pointless while reading/resetting the configuration

parent baa37df2
......@@ -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 );
}
......@@ -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 );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment