From 9e1a79fb29c45215e2a43e8f40eb0545b42bb14e Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 1 Sep 2012 20:50:51 +0200 Subject: Making the AsyncOp behave in a consistent manner for every cases. --- src/Async.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Async.cc b/src/Async.cc index 18c8ef1..8db4f1b 100644 --- a/src/Async.cc +++ b/src/Async.cc @@ -33,10 +33,14 @@ void Balau::AsyncManager::queueOp(AsyncOperation * op) { op->m_idleReadyCallback = tls->idleReadyCallback; op->m_idleReadyParam = tls->idleReadyParam; } - if (op->needsMainQueue()) + if (op->needsMainQueue()) { m_queue.push(op); - else + } else if (op->needsFinishWorker()) { m_finished.push(op); + } else { + op->run(); + op->finalize(); + } } void Balau::AsyncManager::checkIdle() { @@ -120,6 +124,8 @@ void * Balau::AsyncFinishWorker::proc() { Printer::elog(E_ASYNC, "AsyncFinishWorker got a stopper operation"); m_stopping = true; } + if (!op->needsMainQueue()) + op->run(); op->finalize(); } -- cgit v1.2.3