]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wait for thread to start in mod conference to avoid one in a million race on heavy...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 9 Jun 2011 20:31:11 +0000 (15:31 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 9 Jun 2011 20:31:18 +0000 (15:31 -0500)
src/mod/applications/mod_conference/mod_conference.c

index d08eb94d09d0688031ddb6a8f1e0933db0c08f54..572fdf0c8541d30fae0b79b47164866929ebbf70 100644 (file)
@@ -2496,6 +2496,7 @@ static void conference_loop_output(conference_member_t *member)
        uint32_t low_count, bytes;
        call_list_t *call_list, *cp;
        switch_codec_implementation_t read_impl = { 0 };
+       int sanity;
 
        switch_core_session_get_read_impl(member->session, &read_impl);
 
@@ -2596,6 +2597,13 @@ static void conference_loop_output(conference_member_t *member)
                switch_channel_answer(channel);
        }
 
+
+       sanity = 2000;
+       while(!switch_test_flag(member, MFLAG_ITHREAD) && sanity > 0) {
+               switch_cond_next();
+               sanity--;
+       }
+
        /* Fair WARNING, If you expect the caller to hear anything or for digit handling to be processed,      */
        /* you better not block this thread loop for more than the duration of member->conference->timer_name!  */
        while (switch_test_flag(member, MFLAG_RUNNING) && switch_test_flag(member, MFLAG_ITHREAD)