diff options
author | Frédéric Brière <fbriere@fbriere.net> | 2019-09-29 20:20:02 -0400 |
---|---|---|
committer | Frédéric Brière <fbriere@fbriere.net> | 2019-10-02 21:27:25 -0400 |
commit | 79cc23508006d61172522f4b12db8261e760768b (patch) | |
tree | 26ffeaa249e73a96ec08825b2daf1e55b222064f | |
parent | 2e60ab67d1789609f1e7eef11aaebfa9eb440a89 (diff) | |
download | twinkle-79cc23508006d61172522f4b12db8261e760768b.tar twinkle-79cc23508006d61172522f4b12db8261e760768b.tar.gz twinkle-79cc23508006d61172522f4b12db8261e760768b.tar.lz twinkle-79cc23508006d61172522f4b12db8261e760768b.tar.xz twinkle-79cc23508006d61172522f4b12db8261e760768b.zip |
Make `t_phone::mutex_3way` recursive to avoid a deadlock
`t_phone::mutex_3way` can be locked twice when hanging up a conference
call:
- `t_phone::cleanup_3way_state()` acquires a lock
- `t_audio_session::stop_3way()` is called
- `t_audio_session::get_peer_3way()` is called
- `t_phone::get_3way_peer_line()` is called
- which acquires another lock
Making that mutex recursive is a simple way to work around this issue.
-rw-r--r-- | src/phone.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/phone.h b/src/phone.h index f9c18d8..771db3b 100644 --- a/src/phone.h +++ b/src/phone.h @@ -130,7 +130,7 @@ private: bool is_3way; // indicates an acitive 3-way t_line *line1_3way; // first line in 3-way conf t_line *line2_3way; // second line in 3-way conf - mutable t_mutex mutex_3way; + mutable t_recursive_mutex mutex_3way; // Call transfer data. When a REFER comes in, the user has // to give permission before the triggered INVITE can be sent. |