]> git.ipfire.org Git - thirdparty/asterisk.git/commit
stasis/control: Fix possible deadlock with swap channel
authorGeorge Joseph <gjoseph@digium.com>
Fri, 1 Sep 2017 10:17:02 +0000 (04:17 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 6 Sep 2017 17:41:25 +0000 (12:41 -0500)
commit186ef1a657f21029705144dc30dcbe0bebb2d5d7
tree062a6fc3881f9762a61e946cd0f25f589c9242c2
parent9a366d24242a0fc1e7d04b8859ac5773193aa932
stasis/control:  Fix possible deadlock with swap channel

If an error occurs during a bridge impart it's possible that
the "bridge_after" callback might try to run before
control_swap_channel_in_bridge has been signalled to continue.
Since control_swap_channel_in_bridge is holding the control lock
and the callback needs it, a deadlock will occur.

* control_swap_channel_in_bridge now only holds the control
  lock while it's actually modifying the control structure and
  releases it while the bridge impart is running.
* bridge_after_cb is now tolerant of impart failures.

Change-Id: Ifd239aa93955b3eb475521f61e284fcb0da2c3b3
include/asterisk/bridge_after.h
main/bridge.c
main/bridge_after.c
res/stasis/control.c