}
if (!wq_thread) {
- while (m_Tasks.size() >= m_MaxItems)
+ while (m_Tasks.size() >= m_MaxItems && m_MaxItems != 0)
m_CVFull.wait(lock);
}
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();
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);