summaryrefslogtreecommitdiff
path: root/includes/TaskMan.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/TaskMan.h')
-rw-r--r--includes/TaskMan.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/TaskMan.h b/includes/TaskMan.h
index ac95f71..585fb7f 100644
--- a/includes/TaskMan.h
+++ b/includes/TaskMan.h
@@ -1,8 +1,9 @@
#pragma once
+#include <stdint.h>
#include <coro.h>
#include <ext/hash_set>
-#include <stdint.h>
+#include <vector>
namespace gnu = __gnu_cxx;
@@ -15,18 +16,20 @@ class TaskMan {
TaskMan();
~TaskMan();
void mainLoop();
- void stop() { stopped = true; }
+ void stop() { m_stopped = true; }
static TaskMan * getTaskMan();
private:
void registerTask(Task * t);
void unregisterTask(Task * t);
- coro_context returnContext;
+ coro_context m_returnContext;
friend class Task;
- struct taskHash { size_t operator()(const Task * t) const { return reinterpret_cast<uintptr_t>(t); } };
- typedef gnu::hash_set<Task *, taskHash> taskList;
- taskList tasks, pendingAdd;
- volatile bool stopped;
+ struct taskHasher { size_t operator()(const Task * t) const { return reinterpret_cast<uintptr_t>(t); } };
+ typedef gnu::hash_set<Task *, taskHasher> taskHash_t;
+ typedef std::vector<Task *> taskList_t;
+ taskHash_t m_tasks;
+ taskList_t m_pendingAdd;
+ volatile bool m_stopped;
};
};