diff --git a/lib/remote/apiclient.cpp b/lib/remote/apiclient.cpp index 9203094f1..f48a9873c 100644 --- a/lib/remote/apiclient.cpp +++ b/lib/remote/apiclient.cpp @@ -67,7 +67,7 @@ ConnectionRole ApiClient::GetRole(void) const void ApiClient::SendMessage(const Dictionary::Ptr& message) { try { - ObjectLock olock(m_Stream); + boost::mutex::scoped_lock lock(m_WriteMutex); JsonRpc::SendMessage(m_Stream, message); if (message->Get("method") != "log::SetLogPosition") m_Seen = Utility::GetTime(); diff --git a/lib/remote/apiclient.hpp b/lib/remote/apiclient.hpp index b491708c0..666262eaa 100644 --- a/lib/remote/apiclient.hpp +++ b/lib/remote/apiclient.hpp @@ -58,6 +58,7 @@ public: void SendMessage(const Dictionary::Ptr& request); private: + boost::mutex m_WriteMutex; String m_Identity; Endpoint::Ptr m_Endpoint; Stream::Ptr m_Stream;