Merge pull request #5969 from Icinga/feature/wq-stats-mutex

Remove the WorkQueue::m_StatsMutex instance variable
This commit is contained in:
Michael Friedrich 2018-01-11 13:38:40 +01:00 committed by GitHub
commit 01aee7954e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View 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);
}

View 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};