]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix a deadlock caused by a race condition between removing a hint and reloading the...
authorJoshua Colp <jcolp@digium.com>
Mon, 24 Sep 2012 19:17:44 +0000 (19:17 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 24 Sep 2012 19:17:44 +0000 (19:17 +0000)
commit612fb43efc5af9c4c38deb5e4bc0481d2c385814
tree615efe5bebb9803502c2b53188f5671705c1f688
parenta7b98bd2b04f418f19ecbf2df972471b89987cb0
Fix a deadlock caused by a race condition between removing a hint and reloading the dialplan and subscribing to the removed hint.

If conditions were right it was possible for both the PBX core and chan_sip to deadlock by both having a lock that the other
wants. In the case of the PBX core it had the contexts lock and wanted a SIP dialog lock, while in the case of chan_sip it
had the SIP dialog lock and wanted the contexts lock.

This fix unlocks the SIP dialog before getting the extension state so that the other thread will not block on trying to lock
it. Once the extension state is retrieved the SIP dialog is locked again and life carries on.

As the SIP dialog is reference counted it is not possible for it to go away after unlocking.

(closes issue ASTERISK-20437)
Reported by: jhutchins
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@373440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c