mirror of https://github.com/Icinga/icinga2.git
parent
c5ef9f9cbc
commit
e480af3c7f
|
@ -76,7 +76,7 @@ void WorkQueue::Enqueue(const Task& task, bool allowInterleaved)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wq_thread) {
|
if (!wq_thread) {
|
||||||
while (m_Tasks.size() >= m_MaxItems)
|
while (m_Tasks.size() >= m_MaxItems && m_MaxItems != 0)
|
||||||
m_CVFull.wait(lock);
|
m_CVFull.wait(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ void WorkQueue::WorkerThreadProc(void)
|
||||||
if (m_Stopped)
|
if (m_Stopped)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (m_Tasks.size() >= m_MaxItems)
|
if (m_Tasks.size() >= m_MaxItems && m_MaxItems != 0)
|
||||||
m_CVFull.notify_all();
|
m_CVFull.notify_all();
|
||||||
|
|
||||||
Task task = m_Tasks.front();
|
Task task = m_Tasks.front();
|
||||||
|
|
|
@ -44,7 +44,7 @@ class I2_BASE_API WorkQueue
|
||||||
public:
|
public:
|
||||||
typedef boost::function<void (boost::exception_ptr)> ExceptionCallback;
|
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);
|
~WorkQueue(void);
|
||||||
|
|
||||||
void Enqueue(const Task& task, bool allowInterleaved = false);
|
void Enqueue(const Task& task, bool allowInterleaved = false);
|
||||||
|
|
Loading…
Reference in New Issue