IAX2, prevent network thread starting before all helper threads are ready
authorAlec L Davis <sivad.a@paradise.net.nz>
Fri, 12 Apr 2013 08:18:20 +0000 (08:18 +0000)
committerAlec L Davis <sivad.a@paradise.net.nz>
Fri, 12 Apr 2013 08:18:20 +0000 (08:18 +0000)
commit3959535615ef417b9dc31a8d721401ca448ec8ba
tree038f9441ffbdefb561bf217a0e85f695d424acec
parent67cc3b53c992c7e5a49acbdda11e4cfe314f2b25
IAX2, prevent network thread starting before all helper threads are ready

On startup, it's possible for a frame to arrive before the processing threads were ready.

In iax2_process_thread() the first pass through falls into ast_cond_wait, should a frame arrive
before we are at ast_cond_wait, the signal will be ignored.
The result iax2_process_thread stays at ast_cond_wait forever, with deferred frames being queued.

Fix: When creating initial idle iax2_process_threads, wait for init_cond to be signalled
after each thread is started.

(issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2427/
........

Merged revisions 385402 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 385403 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_iax2.c