diff --git a/lib/base/workqueue.cpp b/lib/base/workqueue.cpp index f639d1c3f..ea5704198 100644 --- a/lib/base/workqueue.cpp +++ b/lib/base/workqueue.cpp @@ -23,8 +23,8 @@ using namespace icinga; -WorkQueue::WorkQueue(size_t maxItems) - : m_MaxItems(maxItems), m_Executing(false) +WorkQueue::WorkQueue(void) + : m_Executing(false) { } WorkQueue::~WorkQueue(void) @@ -40,9 +40,6 @@ void WorkQueue::Enqueue(const WorkCallback& item) { boost::mutex::scoped_lock lock(m_Mutex); - while (m_Items.size() >= m_MaxItems) - m_CV.wait(lock); - m_Items.push_back(item); m_CV.notify_all(); @@ -87,4 +84,5 @@ void WorkQueue::ExecuteItem(void) } m_Executing = false; + m_CV.notify_all(); } diff --git a/lib/base/workqueue.h b/lib/base/workqueue.h index 9d6a606c0..4be814fe2 100644 --- a/lib/base/workqueue.h +++ b/lib/base/workqueue.h @@ -39,7 +39,7 @@ class I2_BASE_API WorkQueue public: typedef boost::function WorkCallback; - WorkQueue(size_t maxItems = 25000); + WorkQueue(void); ~WorkQueue(void); void Enqueue(const WorkCallback& item);