mirror of https://github.com/Icinga/icinga2.git
Fix workqueue dispatch.
This commit is contained in:
parent
ad3a8f19ed
commit
2487d7069c
|
@ -38,8 +38,10 @@ void WorkQueue::Enqueue(const WorkCallback& item)
|
|||
m_Items.push_back(item);
|
||||
m_CV.notify_all();
|
||||
|
||||
if (!m_Executing)
|
||||
if (!m_Executing) {
|
||||
m_Executing = true;
|
||||
Utility::QueueAsyncCallback(boost::bind(&WorkQueue::ExecuteItem, this));
|
||||
}
|
||||
}
|
||||
|
||||
void WorkQueue::Join(void)
|
||||
|
@ -59,7 +61,6 @@ void WorkQueue::Clear(void)
|
|||
void WorkQueue::ExecuteItem(void)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
m_Executing = true;
|
||||
|
||||
while (!m_Items.empty()) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue