提交 d885488f authored 作者: Anthony Minessale's avatar Anthony Minessale

MODAPP-215

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11978 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4e2ae22d
......@@ -191,6 +191,7 @@ struct switch_runtime {
switch_time_t timestamp;
switch_mutex_t *throttle_mutex;
switch_mutex_t *global_mutex;
switch_mutex_t *global_var_mutex;
uint32_t sps_total;
int32_t sps;
int32_t sps_last;
......
......@@ -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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论