]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis_device_state: Protect the adding/removing of subscriptions. 91/4891/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:28 +0000 (10:56 -0600)
commit7e20cf95cf6246af5d4771e7f606d35da550a263
tree651cacdd9dc3edf9698a1dd01bf8c4881d8f8520
parent382f1d856f89fc3f4b0cfaec3038321250b4f15d
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