summaryrefslogtreecommitdiff
path: root/src/TaskMan.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-16 18:11:21 -0800
committerPixel <pixel@nobis-crew.org>2011-11-16 18:11:21 -0800
commit18beadfdfb761e6a54be6093e65b66a431bacc19 (patch)
treecd8d8cd01e60b41741231bd760fb3892b77af9f3 /src/TaskMan.cc
parent1d796e6cf639354614f1152baab65d317271c357 (diff)
And with the new TaskScheduler system, let's add a way for a new task to stick on another one's thread, if needed. (and it is)
Diffstat (limited to 'src/TaskMan.cc')
-rw-r--r--src/TaskMan.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/TaskMan.cc b/src/TaskMan.cc
index 8c99e52..630d845 100644
--- a/src/TaskMan.cc
+++ b/src/TaskMan.cc
@@ -216,8 +216,14 @@ void Balau::TaskMan::mainLoop() {
Printer::elog(E_TASK, "TaskManager stopping.");
}
-void Balau::TaskMan::registerTask(Balau::Task * t) {
- s_scheduler.registerTask(t);
+void Balau::TaskMan::registerTask(Balau::Task * t, Balau::Task * stick) {
+ if (stick) {
+ TaskMan * tm = stick->getMyTaskMan();
+ tm->addToPending(t);
+ tm->m_evt.send();
+ } else {
+ s_scheduler.registerTask(t);
+ }
}
void Balau::TaskMan::addToPending(Balau::Task * t) {