]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix deadlock on presence state changes. 66/1166/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:24:17 +0000 (15:24 -0500)
commit03fe79f29eae42be24589b323a5ef3fa9259158d
tree82ce2c010667ade4d6f3868bc51a49609eda58d7
parentc2df44ad3ec8685126dd01af6be5bcbd135c1427
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