]> granicus.if.org Git - icinga2/commitdiff
Remove default WQ limits
authorGunnar Beutner <gunnar@beutner.name>
Wed, 2 Sep 2015 07:16:20 +0000 (09:16 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 15 Oct 2015 13:16:51 +0000 (15:16 +0200)
refs #10002

lib/base/workqueue.cpp
lib/base/workqueue.hpp

index 615d21d3affde43fbd38e5eafa1590131bb3f44e..df98148bca28dc1b206d1b8c79a56f1d633aafae 100644 (file)
@@ -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();
index 5d5de74655362fa76006e00a199f68cfaa0ed2ee..6e263cd299ebc110767176725f7fa7c7c14623bf 100644 (file)
@@ -44,7 +44,7 @@ class I2_BASE_API WorkQueue
 public:
        typedef boost::function<void (boost::exception_ptr)> 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);