summaryrefslogtreecommitdiff
path: root/lib/TaskMan.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-27 15:10:33 +0000
committerPixel <Pixel>2001-11-27 15:10:33 +0000
commit76b2e3c19278da49193aa1599a35197b279b4439 (patch)
tree01a9c64a71a7e4568b5f0ad5db3077e0c0311b08 /lib/TaskMan.cc
parent29f8cedf68c5e45ca20078a2a34a07875d7dea5b (diff)
Bug in taskman...
Diffstat (limited to 'lib/TaskMan.cc')
-rw-r--r--lib/TaskMan.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc
index 218ce2f..546bbc6 100644
--- a/lib/TaskMan.cc
+++ b/lib/TaskMan.cc
@@ -92,9 +92,7 @@ void TaskMan::RemoveFromWatches(Task * t) {
}
void TaskMan::WaitFor(Handle * h, Task * t, int flags) {
- if (h->GetHandle() >= 0) {
- w4ha.push_back(w4ha_t(h, flags, t));
- }
+ w4ha.push_back(w4ha_t(h, flags, t));
}
void TaskMan::WaitFor(pid_t p, Task * t) {
@@ -174,8 +172,13 @@ void TaskMan::MainLoop() throw (GeneralException) {
q->events = 0;
} else {
cerr << "==== TaskMan: adding watch over handle \"" << p->ha->GetName() << "\" for task \"" << p->T->GetName() << "\"\n";
- q->fd = p->ha->GetHandle();
- q->events = (p->flags & W4_READING ? POLLIN : 0) | (p->flags & W4_WRITING ? POLLOUT : 0);
+ if (p->ha->CanWatch() {
+ q->fd = p->ha->GetHandle();
+ q->events = (p->flags & W4_READING ? POLLIN : 0) | (p->flags & W4_WRITING ? POLLOUT : 0);
+ } else {
+ cerr << "==== TaskMan: handle can't watch, switching task to burst.\n";
+ p->T->SetBurst();
+ }
}
}