Commit 6714ee37 authored by Andreas Traczyk's avatar Andreas Traczyk

account: fix deadlocks during (un)register

Change-Id: Ieb4821822ecfb1bacfee5ad4abec96f861b63950
parent 0caad44f
......@@ -2507,6 +2507,7 @@ RingAccount::doUnregister(std::function<void(bool)> released_cb)
if (registrationState_ == RegistrationState::INITIALIZING
|| registrationState_ == RegistrationState::ERROR_NEED_MIGRATION) {
lock.unlock();
if (released_cb) released_cb(false);
return;
}
......@@ -2527,9 +2528,10 @@ RingAccount::doUnregister(std::function<void(bool)> released_cb)
saveNodes(dht_.exportNodes());
saveValues(dht_.exportValues());
dht_.join();
setRegistrationState(RegistrationState::UNREGISTERED);
lock.unlock();
setRegistrationState(RegistrationState::UNREGISTERED);
if (released_cb)
released_cb(false);
}
......
......@@ -735,11 +735,12 @@ void SIPAccount::doRegister()
void SIPAccount::doRegister1_()
{
std::lock_guard<std::mutex> lock(configurationMutex_);
if (isIP2IP()) {
doRegister2_();
return;
{
std::lock_guard<std::mutex> lock(configurationMutex_);
if (isIP2IP()) {
doRegister2_();
return;
}
}
std::weak_ptr<SIPAccount> weak_acc = std::static_pointer_cast<SIPAccount>(shared_from_this());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment