summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Brière <fbriere@fbriere.net>2019-09-29 00:27:52 -0400
committerFrédéric Brière <fbriere@fbriere.net>2019-12-27 02:35:05 -0500
commit31a25748fccca729e402aca15fca67eb9cc43c03 (patch)
treea7d19668e0040750316dad4f9d943510941ead9f
parent52fbf19819e911d590da3766898615d6c21027c8 (diff)
downloadtwinkle-31a25748fccca729e402aca15fca67eb9cc43c03.tar
twinkle-31a25748fccca729e402aca15fca67eb9cc43c03.tar.gz
twinkle-31a25748fccca729e402aca15fca67eb9cc43c03.tar.lz
twinkle-31a25748fccca729e402aca15fca67eb9cc43c03.tar.xz
twinkle-31a25748fccca729e402aca15fca67eb9cc43c03.zip
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
-rw-r--r--src/phone.cpp2
1 files changed, 1 insertions, 1 deletions
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'