diff options
author | Pixel <pixel@nobis-crew.org> | 2011-10-09 01:12:50 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-10-09 01:12:50 -0700 |
commit | 864eeb3a526b1a32c72e1f31a3e1f23dcc5c7409 (patch) | |
tree | 7cc7037e2d7137180a67fb10b29469d4d68e677f /tests/test-Tasks.cc | |
parent | 4f7b984f9f848ba6adae2040c520a97bb5c0e354 (diff) |
More work on the Task manager.
Now "Main" is a Task, among the most important changes. Introduced the notion of Events, and managed a coherent task switch.
Also, renamed a lot of the variables to have a more coherent naming scheme.
Diffstat (limited to 'tests/test-Tasks.cc')
-rw-r--r-- | tests/test-Tasks.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test-Tasks.cc b/tests/test-Tasks.cc index 2eedb47..dcc692c 100644 --- a/tests/test-Tasks.cc +++ b/tests/test-Tasks.cc @@ -11,23 +11,25 @@ class CustomPrinter : public Printer { static CustomPrinter * customPrinter = NULL; -class MainTask : public Task { +class TestTask : public Task { public: virtual const char * getName() { return "MainTask"; } private: virtual void Do() { + Printer::log(M_STATUS, "xyz"); customPrinter->setLocal(); Printer::enable(M_ALL); - Printer::log(M_DEBUG, "In MainTask::Do()"); + Printer::log(M_DEBUG, "In TestTask::Do()"); } }; -int Application::startup() throw (Balau::GeneralException) { +void MainTask::Do() { customPrinter = new CustomPrinter(); Printer::log(M_STATUS, "Test::Tasks running."); - Task * mainTask = new MainTask(); - TaskMan::getTaskMan()->mainLoop(); + Task * testTask = new TestTask(); + Events::TaskEvent e(testTask); + waitFor(&e); + suspend(); Printer::log(M_STATUS, "Test::Tasks passed."); Printer::log(M_DEBUG, "You shouldn't see that message."); - return 0; } |