]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis_device_state: Protect the adding/removing of subscriptions. 90/4890/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:05 +0000 (16:56 +0000)
commit7b39d6901a97d24eec3b9a78868df606790a081b
treed89622024b0c2b4242343cfaf3e859d389a6a656
parent431923feb6167b2536ba0f72ff3954c0b06ae402
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