MODAPP-215
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11978 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4e2ae22d67
commit
d885488f15
|
@ -191,6 +191,7 @@ struct switch_runtime {
|
||||||
switch_time_t timestamp;
|
switch_time_t timestamp;
|
||||||
switch_mutex_t *throttle_mutex;
|
switch_mutex_t *throttle_mutex;
|
||||||
switch_mutex_t *global_mutex;
|
switch_mutex_t *global_mutex;
|
||||||
|
switch_mutex_t *global_var_mutex;
|
||||||
uint32_t sps_total;
|
uint32_t sps_total;
|
||||||
int32_t sps;
|
int32_t sps;
|
||||||
int32_t sps_last;
|
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)
|
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||||
{
|
{
|
||||||
char *val;
|
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);
|
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;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
||||||
char *val;
|
char *val;
|
||||||
|
|
||||||
if (varname) {
|
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);
|
val = (char *) switch_core_hash_find(runtime.global_vars, varname);
|
||||||
if (val) {
|
if (val) {
|
||||||
free(val);
|
free(val);
|
||||||
|
@ -266,7 +266,7 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
||||||
} else {
|
} else {
|
||||||
switch_core_hash_delete(runtime.global_vars, varname);
|
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.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_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_set_globals();
|
||||||
switch_core_session_init(runtime.memory_pool);
|
switch_core_session_init(runtime.memory_pool);
|
||||||
switch_core_hash_init(&runtime.global_vars, runtime.memory_pool);
|
switch_core_hash_init(&runtime.global_vars, runtime.memory_pool);
|
||||||
|
|
Loading…
Reference in New Issue