From e480af3c7fb4bc2b39d4a262bb7f588f84dc79ac Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 2 Sep 2015 09:16:20 +0200 Subject: [PATCH] Remove default WQ limits refs #10002 --- lib/base/workqueue.cpp | 4 ++-- lib/base/workqueue.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 5d5de7465..6e263cd29 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);