SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
{
char *val;
- switch_mutex_lock(runtime.global_mutex);
+ switch_mutex_lock(runtime.global_var_mutex);
val = (char *) switch_core_hash_find(runtime.global_vars, varname);
- switch_mutex_unlock(runtime.global_mutex);
+ switch_mutex_unlock(runtime.global_var_mutex);
return val;
}
char *val;
if (varname) {
- switch_mutex_lock(runtime.global_mutex);
+ switch_mutex_lock(runtime.global_var_mutex);
val = (char *) switch_core_hash_find(runtime.global_vars, varname);
if (val) {
free(val);
} else {
switch_core_hash_delete(runtime.global_vars, varname);
}
- switch_mutex_unlock(runtime.global_mutex);
+ switch_mutex_unlock(runtime.global_var_mutex);
}
}
switch_mutex_init(&runtime.throttle_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
switch_mutex_init(&runtime.global_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
+ switch_mutex_init(&runtime.global_var_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
switch_core_set_globals();
switch_core_session_init(runtime.memory_pool);
switch_core_hash_init(&runtime.global_vars, runtime.memory_pool);