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

Freeswitch SVN anthm at freeswitch.org
Sat Nov 1 12:18:04 EDT 2008


Author: anthm
Date: Sat Nov  1 12:18:04 2008
New Revision: 10216

Modified:
   freeswitch/trunk/src/switch_core_rwlock.c
   freeswitch/trunk/src/switch_core_session.c

Log:
move logic down a step

Modified: freeswitch/trunk/src/switch_core_rwlock.c
==============================================================================
--- freeswitch/trunk/src/switch_core_rwlock.c	(original)
+++ freeswitch/trunk/src/switch_core_rwlock.c	Sat Nov  1 12:18:04 2008
@@ -45,7 +45,7 @@
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
 	if (session->rwlock) {
-		if (switch_test_flag(session, SSF_DESTROYED)) {
+		if (switch_test_flag(session, SSF_DESTROYED) || switch_channel_get_state(session->channel) >= CS_HANGUP) {
 			status = SWITCH_STATUS_FALSE;
 #ifdef SWITCH_DEBUG_RWLOCKS
 			switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "%s Read lock FAIL\n",

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Sat Nov  1 12:18:04 2008
@@ -57,11 +57,9 @@
 		if ((session = switch_core_hash_find(session_manager.session_table, uuid_str))) {
 			/* Acquire a read lock on the session */
 #ifdef SWITCH_DEBUG_RWLOCKS
-			if (switch_channel_get_state(session->channel) >= CS_HANGUP || switch_test_flag(session, SSF_DESTROYED) ||
-				switch_core_session_perform_read_lock(session, file, func, line) != SWITCH_STATUS_SUCCESS) {
+			if (switch_core_session_perform_read_lock(session, file, func, line) != SWITCH_STATUS_SUCCESS) {
 #else
-			if (switch_channel_get_state(session->channel) >= CS_HANGUP || switch_test_flag(session, SSF_DESTROYED) ||
-				switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
+			if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
 #endif
 				/* not available, forget it */
 				session = NULL;



More information about the Freeswitch-svn mailing list