]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix deadlock on presence state changes. 67/1167/1
authorMark Michelson <mmichelson@digium.com>
Mon, 31 Aug 2015 20:24:17 +0000 (15:24 -0500)
committerMark Michelson <mmichelson@digium.com>
Mon, 31 Aug 2015 20:33:41 +0000 (15:33 -0500)
commit88ee3b3ef2e9ba4382be19730b38501d152d659e
treed42e268c7bb91f9856c1db3f466dd1b5491b05f1
parent9121de6e9b4bccb76e119743732d4b406a7b7c1b
Fix deadlock on presence state changes.

A deadlock was observed where three threads were competing for different
locks:

* One thread held the hints lock and was attempting to lock a specific
  hint.
* One thread was holding the specific hint's lock and was attempting to
  lock the contexts lock
* One thread was holding the contexts lock and attempting to lock the
  hints lock.

Clearly the second thread was doing the wrong thing here. The fix for
this is to make sure that the hint's lock is not held on presence state
changes. Something similar is already done (and commented about) for
device state changes.

ASTERISK-25362 #close
Reported by Mark Michelson

Change-Id: I15ec2416b92978a4c0c08273b2d46cb21aff97e2
main/pbx.c