]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis_device_state: Protect the adding/removing of subscriptions. 92/4892/3
authorJoshua Colp <jcolp@digium.com>
Mon, 6 Feb 2017 17:40:45 +0000 (17:40 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 7 Feb 2017 16:56:34 +0000 (10:56 -0600)
commitb79cc62057a456e68ba68b76d3664faf5fec8fb8
tree64b5ad004e6a54f274af64bde94a0be6dec469b6
parentb47cf1a7d6aba11b145b14883e8c607362756001
res_stasis_device_state: Protect the adding/removing of subscriptions.

The adding and removing of device state subscriptions did not protect
fully against simultaneous manipulation. In particular the subscribe
case allowed a small window where two subscriptions could be added for
the same device state instead of just one.

This change makes the code hold the subscriptions lock for the entirety
of each operation to ensure that two are not occurring at the same time.

ASTERISK-26770

Change-Id: I3e7f8eb9d09de440c9024d2dd52029f6f20e725b
res/res_stasis_device_state.c