Fix workqueue dispatch.

This commit is contained in:
Gunnar Beutner 2013-09-18 17:38:26 +02:00
parent ad3a8f19ed
commit 2487d7069c
1 changed files with 3 additions and 2 deletions

View File

@ -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 {