summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2012-09-01 20:50:51 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2012-09-01 20:50:51 +0200
commit9e1a79fb29c45215e2a43e8f40eb0545b42bb14e (patch)
tree4624fab8466c2a8e27232b9f0a690ba47a0d85ac /src
parent4a893f72cadaa875a920db8949171b002f656e43 (diff)
Making the AsyncOp behave in a consistent manner for every cases.
Diffstat (limited to 'src')
-rw-r--r--src/Async.cc10
1 files changed, 8 insertions, 2 deletions
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();
}