From d440c3f50a918a932293ad98bcec96eaa4683222 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 4 Dec 2011 01:19:09 -0800 Subject: Reworked some things in the architecture, mainly exceptions and asserts. -) Removed Assert() -) Added AAssert(), IAssert(), RAssert(), TAssert() and Failure() -) Reworked all asserts in the code, and added meaningful messages to them. -) Changed the way the startup code is generated; BALAU_STARTUP is no longer necessary. --- includes/TaskMan.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes/TaskMan.h') diff --git a/includes/TaskMan.h b/includes/TaskMan.h index 1e7a2f1..6a50491 100644 --- a/includes/TaskMan.h +++ b/includes/TaskMan.h @@ -27,13 +27,14 @@ class TaskMan { public: TaskMan(); ~TaskMan(); - void mainLoop(); + int mainLoop(); static TaskMan * getDefaultTaskMan(); struct ev_loop * getLoop() { return m_loop; } void signalTask(Task * t); - static void stop(); - void stopMe() { m_stopped = true; } + static void stop(int code); + void stopMe(int code) { m_stopped = true; m_stopCode = code; } static Thread * createThreadedTaskMan(); + bool stopped() { return m_stopped; } private: static void registerTask(Task * t, Task * stick); void * getStack(); @@ -58,9 +59,10 @@ class TaskMan { ev::async m_evt; std::queue m_stacks; int m_nStacks; + int m_stopCode; }; template -T * createTask(T * t, Task * stick) { TaskMan::registerTask(t, stick); Assert(dynamic_cast(t)); return t; } +T * createTask(T * t, Task * stick) { TaskMan::registerTask(t, stick); return t; } }; -- cgit v1.2.3