Skip to content
Snippets Groups Projects
Commit b7f6bfd2 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

account: make callIDSet_ thread safe

Change-Id: Ib3d36408841d1b339a00bf9135b308afaa93b218
parent 387f6988
No related branches found
No related tags found
No related merge requests found
......@@ -122,18 +122,21 @@ Account::~Account()
void
Account::attachCall(const std::string& id)
{
std::lock_guard<std::mutex> lk {callIDSetMtx_};
callIDSet_.insert(id);
}
void
Account::detachCall(const std::string& id)
{
std::lock_guard<std::mutex> lk {callIDSetMtx_};
callIDSet_.erase(id);
}
void
Account::freeAccount()
{
std::lock_guard<std::mutex> lk {callIDSetMtx_};
for (const auto& id : callIDSet_)
Manager::instance().hangupCall(id);
}
......
......@@ -346,6 +346,7 @@ class Account : public Serializable, public std::enable_shared_from_this<Account
/**
* Set of call's ID attached to the account.
*/
std::mutex callIDSetMtx_;
std::set<std::string> callIDSet_;
void enableUpnp(bool state);
......
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