]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add rwlocks to bridge
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 19 Feb 2007 15:20:16 +0000 (15:20 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 19 Feb 2007 15:20:16 +0000 (15:20 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4323 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr.c

index 796b517ae46d6deddab186e8e7e4f0acfdfcc91e..3697189351e07a41a631d7ba85731a9cc914813f 100644 (file)
@@ -1965,7 +1965,8 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
                pre_b = switch_channel_test_flag(chan_a, CF_EARLY_MEDIA);
                ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED);
        }
-
+       switch_core_session_read_lock(session_a);
+       switch_core_session_read_lock(session_b);
 
        switch_channel_set_flag(chan_a, CF_BRIDGED);
 
@@ -2091,6 +2092,9 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
        switch_mutex_lock(data->mutex);
        data->running = 0;
        switch_mutex_unlock(data->mutex);
+
+       switch_core_session_rwunlock(session_a);
+       switch_core_session_rwunlock(session_b);
        return NULL;
 }