summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Brière <fbriere@fbriere.net>2019-09-29 00:38:15 -0400
committerFrédéric Brière <fbriere@fbriere.net>2019-12-27 02:35:10 -0500
commitf1102b9a5e4e45434fb6e581b40f06d8ef39c911 (patch)
treeb1df4083a09257585da2d8bf4791772c7d08f9f4
parent31a25748fccca729e402aca15fca67eb9cc43c03 (diff)
downloadtwinkle-f1102b9a5e4e45434fb6e581b40f06d8ef39c911.tar
twinkle-f1102b9a5e4e45434fb6e581b40f06d8ef39c911.tar.gz
twinkle-f1102b9a5e4e45434fb6e581b40f06d8ef39c911.tar.lz
twinkle-f1102b9a5e4e45434fb6e581b40f06d8ef39c911.tar.xz
twinkle-f1102b9a5e4e45434fb6e581b40f06d8ef39c911.zip
Fix "REFER declined" deadlock
This occurs when the user declines an incoming call transfer request, due to the following path: - recvd_refer_permission() acquires a read lock over lines_mtx - move_releasing_lines_to_background() is called - A write lock over lines_mtx is acquired
-rw-r--r--src/phone.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/phone.cpp b/src/phone.cpp
index 401abb1..2718c82 100644
--- a/src/phone.cpp
+++ b/src/phone.cpp
@@ -1871,7 +1871,7 @@ void t_phone::recvd_refer_permission(bool permission) {
t_phone_user *pu = incoming_refer_data->get_phone_user();
t_user *user_config = pu->get_user_profile();
- t_rwmutex_reader x(lines_mtx);
+ t_rwmutex_future_writer x(lines_mtx);
lines[i]->recvd_refer_permission(permission, r);
if (!permission) {