From: Anthony Minessale Date: Thu, 9 Jun 2011 20:31:11 +0000 (-0500) Subject: wait for thread to start in mod conference to avoid one in a million race on heavy... X-Git-Tag: v1.2-rc1~108^2~11^2~31^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1cf5bee30b04de2ca3bdfc703257224e60ad9dc;p=thirdparty%2Ffreeswitch.git wait for thread to start in mod conference to avoid one in a million race on heavy traffic --- diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index d08eb94d09..572fdf0c85 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -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)