diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 4adfcfa42..45605dd61 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -1309,37 +1309,37 @@ double ApiListener::CalculateZoneLag(const Endpoint::Ptr& endpoint) void ApiListener::AddAnonymousClient(const JsonRpcConnection::Ptr& aclient) { - ObjectLock olock(this); + boost::mutex::scoped_lock(m_AnonymousClientsLock); m_AnonymousClients.insert(aclient); } void ApiListener::RemoveAnonymousClient(const JsonRpcConnection::Ptr& aclient) { - ObjectLock olock(this); + boost::mutex::scoped_lock(m_AnonymousClientsLock); m_AnonymousClients.erase(aclient); } std::set ApiListener::GetAnonymousClients(void) const { - ObjectLock olock(this); + boost::mutex::scoped_lock(m_AnonymousClientsLock); return m_AnonymousClients; } void ApiListener::AddHttpClient(const HttpServerConnection::Ptr& aclient) { - ObjectLock olock(this); + boost::mutex::scoped_lock(m_HttpClientsLock); m_HttpClients.insert(aclient); } void ApiListener::RemoveHttpClient(const HttpServerConnection::Ptr& aclient) { - ObjectLock olock(this); + boost::mutex::scoped_lock(m_HttpClientsLock); m_HttpClients.erase(aclient); } std::set ApiListener::GetHttpClients(void) const { - ObjectLock olock(this); + boost::mutex::scoped_lock(m_HttpClientsLock); return m_HttpClients; } diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index 665f96d27..e4d244f35 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -115,8 +115,12 @@ protected: private: boost::shared_ptr m_SSLContext; std::set m_Servers; + + mutable boost::mutex m_AnonymousClientsLock; + mutable boost::mutex m_HttpClientsLock; std::set m_AnonymousClients; std::set m_HttpClients; + Timer::Ptr m_Timer; Timer::Ptr m_ReconnectTimer; Timer::Ptr m_AuthorityTimer;