]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix locking bug
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 15 May 2007 02:21:53 +0000 (02:21 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 15 May 2007 02:21:53 +0000 (02:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5183 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_core.h
src/mod/applications/mod_commands/mod_commands.c
src/switch_ivr_bridge.c

index 35c69bda7f6e84f6be14b83ebc5d61d90ee3ff51..afd85294c2504aaf3ebeb8a91d8c9bdd2b0c07cd 100644 (file)
@@ -491,7 +491,7 @@ SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session_t *sessi
 SWITCH_DECLARE(char *) switch_core_get_uuid(void);
 
 #ifdef SWITCH_DEBUG_RWLOCKS
-SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(char *uuid_str, const char *file, const char *func, int line);
+SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line);
 #endif
 
 /*! 
index c93ab9e31e85149ae02efa0acc419fdedd538b21..a90011a34e2178bdf63bad6e26ab70fb1c535dec 100644 (file)
@@ -575,7 +575,7 @@ SWITCH_STANDARD_API(session_record_function)
                stream->write_function(stream, "-Error Cannot locate session!\n");
                return SWITCH_STATUS_SUCCESS;
        }
-
+       
        if (switch_strlen_zero(action) || switch_strlen_zero(path)) {
                goto usage;
        }
@@ -594,11 +594,11 @@ SWITCH_STANDARD_API(session_record_function)
 
        stream->write_function(stream, "USAGE: %s\n", session_record_api_interface.syntax);
        switch_safe_free(mycmd);
-       return SWITCH_STATUS_SUCCESS;
+
 
   done:
 
-       if (session) {
+       if (rsession) {
                switch_core_session_rwunlock(rsession);
        }
 
index 74900388a2bcc0119c16e251b4a96296cc5a2ae9..c13b73813de52c0c3a023d88b925e3084214fd97 100644 (file)
@@ -644,14 +644,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, ch
                        switch_channel_set_state_flag(originator_channel, CF_TRANSFER);
                        switch_channel_set_state_flag(originatee_channel, CF_TRANSFER);
 
-                       /* release the read locks we have on the channels */
-                       switch_core_session_rwunlock(originator_session);
-                       switch_core_session_rwunlock(originatee_session);
-
                        /* change the states and let the chips fall where they may */
                        switch_channel_set_state(originator_channel, CS_TRANSMIT);
                        switch_channel_set_state(originatee_channel, CS_TRANSMIT);
 
+                       /* release the read locks we have on the channels */
+                       switch_core_session_rwunlock(originator_session);
+                       switch_core_session_rwunlock(originatee_session);
+
                        status = SWITCH_STATUS_SUCCESS;
 
                        while (switch_channel_get_state(originatee_channel) < CS_HANGUP && switch_channel_test_flag(originatee_channel, CF_TAGGED)) {