chan_iax2: Fix bridgecallno deadlock avoidance.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 5 Sep 2013 17:17:53 +0000 (17:17 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 5 Sep 2013 17:17:53 +0000 (17:17 +0000)
commitbdb0121769a47b1e8e2f043679746dc017e7068b
tree9488486dcdae2433b2a284ded31e76a029afc460
parent23ed2ca57f8b57f324a66192cb1385ac283163dd
chan_iax2: Fix bridgecallno deadlock avoidance.

* Fix bridgecallno deadlock avoidance.  When doing deadlock avoidance, you
need to retest the status of values for each loop to see if you still need
the lock for bridgecallno.

* As a safety check, after acquiring the bridgecallno lock you should
check if iaxs[bridgecallno] is NULL just like the current callno checks.

* Move setting thread->iostate to IAX_IOSTATE_IDLE to after processing any
deferred frames to ensure that the iostate is IDLE when it is placed back
into the idle list.  defer_full_frame() tries to ensure
iax2_process_thread() wakes up to process the frame.
........

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

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

Merged revisions 398381 from http://svn.asterisk.org/svn/asterisk/branches/12

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