diff --git a/lib/perfdata/graphitewriter.cpp b/lib/perfdata/graphitewriter.cpp index a01f6c48b..1b6461d51 100644 --- a/lib/perfdata/graphitewriter.cpp +++ b/lib/perfdata/graphitewriter.cpp @@ -299,7 +299,7 @@ void GraphiteWriter::SendMetric(const String& prefix, const String& name, double msgbuf << "\n"; String metric = msgbuf.str(); - ObjectLock olock(this); + boost::mutex::scoped_lock lock(m_StreamMutex); if (!GetConnected()) return; diff --git a/lib/perfdata/graphitewriter.hpp b/lib/perfdata/graphitewriter.hpp index 6934d13b3..ec4c5bbfe 100644 --- a/lib/perfdata/graphitewriter.hpp +++ b/lib/perfdata/graphitewriter.hpp @@ -27,6 +27,7 @@ #include "base/timer.hpp" #include "base/workqueue.hpp" #include +#include namespace icinga { @@ -54,6 +55,7 @@ protected: private: Stream::Ptr m_Stream; + boost::mutex m_StreamMutex; WorkQueue m_WorkQueue{10000000, 1}; Timer::Ptr m_ReconnectTimer;