[Freeswitch-svn] [commit] r5749 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Mon Sep 24 12:10:12 EDT 2007


Author: anthm
Date: Mon Sep 24 12:10:12 2007
New Revision: 5749

Modified:
   freeswitch/trunk/src/switch_channel.c

Log:
fix for FSCORE-51 (maybe)

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Mon Sep 24 12:10:12 2007
@@ -360,7 +360,7 @@
 {
 	assert(channel != NULL);
 	switch_mutex_lock(channel->profile_mutex);
-	switch_core_hash_insert_dup(channel->private_hash, switch_core_session_strdup(channel->session, key), private_info);
+	switch_core_hash_insert_dup_locked(channel->private_hash, switch_core_session_strdup(channel->session, key), private_info, channel->flag_mutex);
 	switch_mutex_unlock(channel->profile_mutex);
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -400,11 +400,12 @@
 
 	if (varname) {
 		switch_mutex_lock(channel->profile_mutex);
-		switch_core_hash_delete(channel->variables, varname);
+		switch_core_hash_delete_locked(channel->variables, varname, channel->flag_mutex);
 		if (!switch_strlen_zero(value)) {
-			switch_core_hash_insert_dup(channel->variables, varname, switch_clean_string(switch_core_session_strdup(channel->session, value)));
+			switch_core_hash_insert_dup_locked(channel->variables, varname, 
+											   switch_clean_string(switch_core_session_strdup(channel->session, value)), channel->flag_mutex);
 		} else {
-			switch_core_hash_delete(channel->variables, varname);
+			switch_core_hash_delete_locked(channel->variables, varname, channel->flag_mutex);
 		}
 		switch_mutex_unlock(channel->profile_mutex);
 		return SWITCH_STATUS_SUCCESS;
@@ -419,11 +420,11 @@
 
 	if (varname) {
 		switch_mutex_lock(channel->profile_mutex);
-		switch_core_hash_delete(channel->variables, varname);
+		switch_core_hash_delete_locked(channel->variables, varname, channel->flag_mutex);
 		if (!switch_strlen_zero(value)) {
-			switch_core_hash_insert_dup(channel->variables, varname, value);
+			switch_core_hash_insert_dup_locked(channel->variables, varname, value, channel->flag_mutex);
 		} else {
-			switch_core_hash_delete(channel->variables, varname);
+			switch_core_hash_delete_locked(channel->variables, varname, channel->flag_mutex);
 		}
 		switch_mutex_unlock(channel->profile_mutex);
 		return SWITCH_STATUS_SUCCESS;



More information about the Freeswitch-svn mailing list