From 79cc23508006d61172522f4b12db8261e760768b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sun, 29 Sep 2019 20:20:02 -0400 Subject: 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. --- src/phone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- cgit v1.2.3