diff TaskManager/kernel/main.cc @ 216:e9a52d68db42 draft

rename cerium_main to TMmain, add TMend()
author gongo@localhost.localdomain
date Wed, 04 Feb 2009 22:44:16 +0900
parents 028ffc9c0375
children 23e76c5369b7 1e697b4b7e1f
line wrap: on
line diff
--- a/TaskManager/kernel/main.cc	Sun Feb 01 20:46:39 2009 +0900
+++ b/TaskManager/kernel/main.cc	Wed Feb 04 22:44:16 2009 +0900
@@ -3,8 +3,12 @@
 #include <SDL.h>
 #include "TaskManager.h"
 
-/* for user main function */
-extern int cerium_main(int argc, char *argv[]);
+/* User main function */
+extern int TMmain(int argc, char *argv[]);
+
+/* Default TMend function */
+static void
+defaultTMend(void) {}
 
 TaskManager *manager;
 static char *help_str = "\n\
@@ -30,12 +34,16 @@
     manager = new TaskManager(cpuNum);
     manager->init();
 
-    if (cerium_main(argc, argv) < 0) {
+    manager->set_TMend(defaultTMend);
+
+    if (TMmain(argc, argv) < 0) {
 	goto FINISH;
     }
 
     manager->run();
 
+    (manager->tm_end)();
+
 FINISH:
     delete manager;