Skip to content
Snippets Groups Projects
Commit e31d1d72 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

call: avoid potential deadlock

Do not emit CallSignal::StateChange while locked. Because if the
client uses any method that lock callMutex_ it will be a deadlock.

Change-Id: I49aa7cb4ee60b23ef069751a7c1abbf4c9fcec95
parent d7528947
No related branches found
No related tags found
No related merge requests found
......@@ -240,7 +240,7 @@ Call::validStateTransition(CallState newState)
bool
Call::setState(CallState call_state, ConnectionState cnx_state, signed code)
{
std::lock_guard<std::recursive_mutex> lock(callMutex_);
std::unique_lock<std::recursive_mutex> lock(callMutex_);
JAMI_DBG("[call:%s] state change %u/%u, cnx %u/%u, code %d",
id_.c_str(),
(unsigned) callState_,
......@@ -275,6 +275,7 @@ Call::setState(CallState call_state, ConnectionState cnx_state, signed code)
id_.c_str(),
new_client_state.c_str(),
code);
lock.unlock();
emitSignal<DRing::CallSignal::StateChange>(id_, new_client_state, code);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment