Fix another deadlock in ApiClient::SendMessage

refs #6368
This commit is contained in:
Gunnar Beutner 2014-06-30 14:01:07 +02:00
parent 0ac6e97f32
commit a0c0930325
2 changed files with 2 additions and 1 deletions

View File

@ -67,7 +67,7 @@ ConnectionRole ApiClient::GetRole(void) const
void ApiClient::SendMessage(const Dictionary::Ptr& message) void ApiClient::SendMessage(const Dictionary::Ptr& message)
{ {
try { try {
ObjectLock olock(m_Stream); boost::mutex::scoped_lock lock(m_WriteMutex);
JsonRpc::SendMessage(m_Stream, message); JsonRpc::SendMessage(m_Stream, message);
if (message->Get("method") != "log::SetLogPosition") if (message->Get("method") != "log::SetLogPosition")
m_Seen = Utility::GetTime(); m_Seen = Utility::GetTime();

View File

@ -58,6 +58,7 @@ public:
void SendMessage(const Dictionary::Ptr& request); void SendMessage(const Dictionary::Ptr& request);
private: private:
boost::mutex m_WriteMutex;
String m_Identity; String m_Identity;
Endpoint::Ptr m_Endpoint; Endpoint::Ptr m_Endpoint;
Stream::Ptr m_Stream; Stream::Ptr m_Stream;