diff options
Diffstat (limited to 'lib/TaskMan.cc')
-rw-r--r-- | lib/TaskMan.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index e75863b..1bc8cd8 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -6,7 +6,7 @@ #include <sys/time.h> #include <sys/types.h> #include <unistd.h> -#include <vector.h> +#include <vector> #include "TaskMan.h" #include "config.h" @@ -14,9 +14,9 @@ TaskMan::TaskList_t TaskMan::TaskList; TaskMan::TaskList_t TaskMan::Zombies; -vector<TaskMan::w4ha_t> TaskMan::w4ha; -vector<TaskMan::w4pr_t> TaskMan::w4pr; -vector<TaskMan::w4to_t> TaskMan::w4to; +std::vector<TaskMan::w4ha_t> TaskMan::w4ha; +std::vector<TaskMan::w4pr_t> TaskMan::w4pr; +std::vector<TaskMan::w4to_t> TaskMan::w4to; bool TaskMan::stopped = false; int TaskMan::number = 0; @@ -116,7 +116,7 @@ void TaskMan::AddTask(Task * t) { } } -vector<Task *>::iterator TaskMan::FindTask(Task * t) throw (GeneralException) { +std::vector<Task *>::iterator TaskMan::FindTask(Task * t) throw (GeneralException) { if (!inited) { Init(); } @@ -124,7 +124,7 @@ vector<Task *>::iterator TaskMan::FindTask(Task * t) throw (GeneralException) { if (TaskList.empty()) throw TaskNotFound(); - for (vector<Task *>::iterator p = TaskList.begin(); p != TaskList.end(); p++) { + for (std::vector<Task *>::iterator p = TaskList.begin(); p != TaskList.end(); p++) { if (*p == t) { return p; } @@ -135,7 +135,7 @@ vector<Task *>::iterator TaskMan::FindTask(Task * t) throw (GeneralException) { void TaskMan::RemoveFromWatches(Task * t) { if (!w4ha.empty()) { - for (vector<w4ha_t>::iterator p = w4ha.begin(); p != w4ha.end(); p++) { + for (std::vector<w4ha_t>::iterator p = w4ha.begin(); p != w4ha.end(); p++) { if (p->T == t) { w4ha.erase(p); p--; @@ -144,7 +144,7 @@ void TaskMan::RemoveFromWatches(Task * t) { } if (!w4pr.empty()) { - for (vector<w4pr_t>::iterator p = w4pr.begin(); p != w4pr.end(); p++) { + for (std::vector<w4pr_t>::iterator p = w4pr.begin(); p != w4pr.end(); p++) { if (p->T == t) { w4pr.erase(p); p--; @@ -153,7 +153,7 @@ void TaskMan::RemoveFromWatches(Task * t) { } if (!w4to.empty()) { - for (vector<w4to_t>::iterator p = w4to.begin(); p != w4to.end(); p++) { + for (std::vector<w4to_t>::iterator p = w4to.begin(); p != w4to.end(); p++) { if (p->T == t) { w4to.erase(p); p--; @@ -186,7 +186,7 @@ void TaskMan::WaitFor(Handle * h, Task * t, int flags) { void TaskMan::WaitFor(pid_t pid, Task * t, int status) { if (status == -1) { if (!w4pr.empty()) { - for (vector<w4pr_t>::iterator p = w4pr.begin(); p != w4pr.end(); p++) { + for (std::vector<w4pr_t>::iterator p = w4pr.begin(); p != w4pr.end(); p++) { if (p->pr == pid) { p->T = t; p->flag = true; @@ -272,7 +272,7 @@ void TaskMan::MainLoop() throw (GeneralException) { if (nfds != 0) { int r; - vector<w4ha_t>::iterator p; + std::vector<w4ha_t>::iterator p; #ifdef USE_POLL struct pollfd * q; #else @@ -369,7 +369,7 @@ void TaskMan::MainLoop() throw (GeneralException) { // We have to look into the handle structure now... bool touched; if (!w4ha.empty()) { - for (vector<w4ha_t>::iterator p = w4ha.begin(); p != w4ha.end(); p = touched ? w4ha.begin() : p + 1) { + for (std::vector<w4ha_t>::iterator p = w4ha.begin(); p != w4ha.end(); p = touched ? w4ha.begin() : p + 1) { touched = false; if ((p->ha->GetHandle() == fd) && (!p->T->IsStopped()) && (p->T->GetState() != TASK_DONE) && (!p->dirthy)) { // We've got one, launch it. @@ -389,7 +389,7 @@ void TaskMan::MainLoop() throw (GeneralException) { if (w4.T->GetState() == TASK_DONE) { // This task died, remove it. try { - vector<Task *>::iterator q = FindTask(w4.T); + std::vector<Task *>::iterator q = FindTask(w4.T); TaskList.erase(q); number--; Zombies.push_back(w4.T); @@ -452,7 +452,7 @@ void TaskMan::MainLoop() throw (GeneralException) { if (got_sigchild) { if (!w4pr.empty()) { - for (vector<w4pr_t>::iterator p = w4pr.begin(); p != w4pr.end(); p++) { + for (std::vector<w4pr_t>::iterator p = w4pr.begin(); p != w4pr.end(); p++) { if (p->flag) { Task * t; if (p->T->IsStopped()) { |