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