]> granicus.if.org Git - icinga2/commitdiff
Remove the WorkQueue::m_StatsMutex instance variable 5969/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 11 Jan 2018 09:47:55 +0000 (10:47 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 11 Jan 2018 09:48:19 +0000 (10:48 +0100)
lib/base/workqueue.cpp
lib/base/workqueue.hpp

index e55eab2ad62e1f3422416dff457b7f26f25502d0..ae3dad9b053a7ef16ef5812c1cabd93c16dbbfef 100644 (file)
@@ -310,15 +310,11 @@ void WorkQueue::WorkerThreadProc()
 
 void WorkQueue::IncreaseTaskCount()
 {
-       double now = Utility::GetTime();
-
-       boost::mutex::scoped_lock lock(m_StatsMutex);
-       m_TaskStats.InsertValue(now, 1);
+       m_TaskStats.InsertValue(Utility::GetTime(), 1);
 }
 
 size_t WorkQueue::GetTaskCount(RingBuffer::SizeType span)
 {
-       boost::mutex::scoped_lock lock(m_StatsMutex);
        return m_TaskStats.UpdateAndGetValues(Utility::GetTime(), span);
 }
 
index cdb6c437ba419a99839f9bfebe188b3db52f1216..002e5f21c2939467603f1e29ba6e68f64b681763 100644 (file)
@@ -146,7 +146,6 @@ private:
        Timer::Ptr m_StatusTimer;
        double m_StatusTimerTimeout;
 
-       mutable boost::mutex m_StatsMutex;
        RingBuffer m_TaskStats;
        size_t m_PendingTasks{0};
        double m_PendingTasksTimestamp{0};