diff options
author | Pixel <Pixel> | 2001-12-24 17:46:35 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-12-24 17:46:35 +0000 |
commit | a19f31f4de26dc13aa5bfbfbeabcea9c7aca9c99 (patch) | |
tree | 31ee69451acdc5cd805f8a1cc6b3154c10b88225 | |
parent | 161823df9ef25327e4bbe2ecf3c6189ce93fd10d (diff) |
Bugfix in the RemoveFromWatches
-rw-r--r-- | lib/TaskMan.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index 1e1fba6..bf1a6be 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -158,6 +158,10 @@ void TaskMan::RemoveFromWatches(Task * t) { TaskList.erase(p); number--; p--; + } else if ((*p) == t) { + TaskList.erase(p); + number--; + p--; } } } @@ -204,6 +208,12 @@ void TaskMan::MainLoop() throw (GeneralException) { if (stopped) return; cerr << "-=- TaskMan: begin main loop with " << number << " task to manage.\n"; + for (TaskList_t::iterator p = TaskList.begin(); p && (p != TaskList.end()); p++) { + Task * t = *p; + cerr << "-=- TaskMan: task " << t->GetName() << endl; + } + + cerr << "-=- TaskMan: processing burning tasks.\n"; no_burst = 0; while (!no_burst) { @@ -213,8 +223,6 @@ void TaskMan::MainLoop() throw (GeneralException) { for (TaskList_t::iterator p = TaskList.begin(); p && (p != TaskList.end()); p++) { Task * t = *p; - cerr << "-=- TaskMan: task " << t->GetName() << endl; - if (t->IsStopped()) { continue; } @@ -239,6 +247,7 @@ void TaskMan::MainLoop() throw (GeneralException) { /* Now is time to check all the handle and enters into a wait state. */ event = E_HANDLE; + cerr << "-=- TaskMan: processing handle-waiting tasks.\n"; nfds = w4ha.size(); no_burst = 1; @@ -382,6 +391,7 @@ void TaskMan::MainLoop() throw (GeneralException) { no_zombies = 0; event = E_TASK; + cerr << "-=- TaskMan: processing zombies loop.\n"; while (!no_zombies) { no_zombies = 1; @@ -418,6 +428,7 @@ void TaskMan::MainLoop() throw (GeneralException) { /* To end up the loop, let's recall task waiting for processes */ event = E_PROCESS; + cerr << "-=- TaskMan: processing child-waiting tasks.\n"; if (got_sigchild) { for (vector<w4pr_t>::iterator p = w4pr.begin(); p && (p != w4pr.end()); p++) { |