summaryrefslogtreecommitdiff
path: root/includes/TaskMan.h
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 /includes/TaskMan.h
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 'includes/TaskMan.h')
-rw-r--r--includes/TaskMan.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/TaskMan.h b/includes/TaskMan.h
index afc2b8a..b9897e4 100644
--- a/includes/TaskMan.h
+++ b/includes/TaskMan.h
@@ -34,7 +34,7 @@ class TaskMan {
static void stop();
void stopMe() { m_stopped = true; }
private:
- static void registerTask(Task * t);
+ static void registerTask(Task * t, Task * stick);
void addToPending(Task * t);
#ifndef _WIN32
coro_context m_returnContext;
@@ -44,7 +44,7 @@ class TaskMan {
friend class Task;
friend class TaskScheduler;
template<class T>
- friend T * createTask(T * t);
+ friend T * createTask(T * t, Task * stick = NULL);
struct taskHasher { size_t operator()(const Task * t) const { return reinterpret_cast<uintptr_t>(t); } };
typedef gnu::hash_set<Task *, taskHasher> taskHash_t;
taskHash_t m_tasks, m_signaledTasks;
@@ -56,6 +56,6 @@ class TaskMan {
};
template<class T>
-T * createTask(T * t) { TaskMan::registerTask(t); Assert(dynamic_cast<Task *>(t)); return t; }
+T * createTask(T * t, Task * stick = NULL) { TaskMan::registerTask(t, stick); Assert(dynamic_cast<Task *>(t)); return t; }
};