From d885488f15dcff85f7af4b8b7db1d4c93c380069 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 13 Feb 2009 00:32:58 +0000 Subject: [PATCH] MODAPP-215 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11978 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/private/switch_core_pvt.h | 1 + src/switch_core.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h index 26c51f93af..6c6c9152a1 100644 --- a/src/include/private/switch_core_pvt.h +++ b/src/include/private/switch_core_pvt.h @@ -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; diff --git a/src/switch_core.c b/src/switch_core.c index ad4a6f27af..ee41a594fe 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -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);