From 31a25748fccca729e402aca15fca67eb9cc43c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sun, 29 Sep 2019 00:27:52 -0400 Subject: Fix "Transfer with consultation without Replaces" deadlock This occurs when performing a consult transfer if the target does not support the Replaces extension, due to the following path: - refer() acquires a read lock over lines_mtx - refer_consultation() is called - A write lock over lines_mtx is acquired Closes #118 --- src/phone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phone.cpp b/src/phone.cpp index c4e515f..401abb1 100644 --- a/src/phone.cpp +++ b/src/phone.cpp @@ -339,7 +339,7 @@ void t_phone::refer(const t_url &uri, const string &display) { void t_phone::refer(unsigned short lineno_from, unsigned short lineno_to) { - t_rwmutex_reader x(lines_mtx); + t_rwmutex_future_writer x(lines_mtx); // The nicest transfer is an attended transfer. An attended transfer // is only possible of the transfer target supports the 'replaces' -- cgit v1.2.3