summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-29 01:45:53 +0000
committerPixel <Pixel>2001-11-29 01:45:53 +0000
commita6f79293000e96e07ab2688541fcb38225d4094f (patch)
tree1074c6dacba04ee19440744d1b06b7da108ece00
parent9788056af63e073607897559997a44272b9a5cef (diff)
Night...
-rw-r--r--include/TaskMan.h2
-rw-r--r--lib/TaskMan.cc7
2 files changed, 9 insertions, 0 deletions
diff --git a/include/TaskMan.h b/include/TaskMan.h
index fd031ee..8cd8e66 100644
--- a/include/TaskMan.h
+++ b/include/TaskMan.h
@@ -16,6 +16,7 @@ class TaskMan : public Base {
static void WaitFor(pid_t, Task *);
static void WaitFor(timeval, Task *, int = 0);
static int GotChild(pid_t, int);
+ static void Stop();
class w4ha_t {
public:
@@ -51,6 +52,7 @@ class TaskMan : public Base {
static vector<w4ha_t> w4ha;
static vector<w4pr_t> w4pr;
static vector<w4to_t> w4to;
+ static bool stopped;
};
#else
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc
index 60bcdf6..f18bcf7 100644
--- a/lib/TaskMan.cc
+++ b/lib/TaskMan.cc
@@ -17,6 +17,7 @@ TaskMan::TaskList_t TaskMan::Zombies;
vector<TaskMan::w4ha_t> TaskMan::w4ha;
vector<TaskMan::w4pr_t> TaskMan::w4pr;
vector<TaskMan::w4to_t> TaskMan::w4to;
+bool TaskMan::stopped = false;
int TaskMan::number = 0;
bool TaskMan::inited = false;
@@ -64,6 +65,10 @@ void TaskMan::Init() throw (GeneralException) {
number = 0;
}
+void TaskMan::Stop() {
+ stopped = true;
+}
+
void TaskMan::AddTask(Task * t) {
if (!inited) {
Init();
@@ -140,6 +145,8 @@ void TaskMan::MainLoop() throw (GeneralException) {
throw GeneralException("TaskMan: No more task to manage.");
}
+ if (stopped) return;
+
// cerr << "-=- TaskMan: begin main loop with " << number << " task to manage.\n";
no_burst = 0;