From 76b2e3c19278da49193aa1599a35197b279b4439 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 27 Nov 2001 15:10:33 +0000 Subject: Bug in taskman... --- lib/TaskMan.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/TaskMan.cc') 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(); + } } } -- cgit v1.2.3