From: Gunnar Beutner Date: Wed, 2 Sep 2015 07:16:20 +0000 (+0200) Subject: Remove default WQ limits X-Git-Tag: v2.4.0~342 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35acba7dc1e5b2fc621c8c3ef9290ab039a5a14b;p=icinga2 Remove default WQ limits refs #10002 --- diff --git a/lib/base/workqueue.cpp b/lib/base/workqueue.cpp index 615d21d3a..df98148bc 100644 --- a/lib/base/workqueue.cpp +++ b/lib/base/workqueue.cpp @@ -76,7 +76,7 @@ void WorkQueue::Enqueue(const Task& task, bool allowInterleaved) } if (!wq_thread) { - while (m_Tasks.size() >= m_MaxItems) + while (m_Tasks.size() >= m_MaxItems && m_MaxItems != 0) m_CVFull.wait(lock); } @@ -198,7 +198,7 @@ void WorkQueue::WorkerThreadProc(void) if (m_Stopped) break; - if (m_Tasks.size() >= m_MaxItems) + if (m_Tasks.size() >= m_MaxItems && m_MaxItems != 0) m_CVFull.notify_all(); Task task = m_Tasks.front(); diff --git a/lib/base/workqueue.hpp b/lib/base/workqueue.hpp index ac314131a..c6088b74e 100644 --- a/lib/base/workqueue.hpp +++ b/lib/base/workqueue.hpp @@ -44,7 +44,7 @@ class I2_BASE_API WorkQueue public: typedef boost::function ExceptionCallback; - WorkQueue(size_t maxItems = 25000, int threadCount = 1); + WorkQueue(size_t maxItems = 0, int threadCount = 1); ~WorkQueue(void); void Enqueue(const Task& task, bool allowInterleaved = false);