mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
MODAPP-215
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11978 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -243,9 +243,9 @@ SWITCH_DECLARE(void) switch_core_dump_variables(switch_stream_handle_t *stream)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
||||
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);
|
||||
@@ -266,7 +266,7 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
||||
} else {
|
||||
switch_core_hash_delete(runtime.global_vars, varname);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_mutex);
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1046,6 +1046,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user