[Freeswitch-svn] [commit] r11978 - in freeswitch/trunk/src: . include/private

FreeSWITCH SVN anthm at freeswitch.org
Thu Feb 12 16:32:58 PST 2009


Author: anthm
Date: Thu Feb 12 18:32:58 2009
New Revision: 11978

Log:
MODAPP-215

Modified:
   freeswitch/trunk/src/include/private/switch_core_pvt.h
   freeswitch/trunk/src/switch_core.c

Modified: freeswitch/trunk/src/include/private/switch_core_pvt.h
==============================================================================
--- freeswitch/trunk/src/include/private/switch_core_pvt.h	(original)
+++ freeswitch/trunk/src/include/private/switch_core_pvt.h	Thu Feb 12 18:32:58 2009
@@ -191,6 +191,7 @@
 	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;

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Thu Feb 12 18:32:58 2009
@@ -243,9 +243,9 @@
 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 @@
 	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 @@
 		} 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_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);



More information about the Freeswitch-svn mailing list