summaryrefslogtreecommitdiff
path: root/lib/Task.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Task.cc')
-rw-r--r--lib/Task.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Task.cc b/lib/Task.cc
index bc7c7a0..72023e4 100644
--- a/lib/Task.cc
+++ b/lib/Task.cc
@@ -17,20 +17,17 @@ int Task::Do() throw (GeneralException) {
}
int Task::Run() {
- cerr << "==== Task: \"" << GetName() << "\" running.\n";
try {
state = Do();
}
catch (TaskSwitch) {
- cerr << "==== Task: \"" << GetName() << "\" caugh a task switch. returning " << (state == TASK_ON_HOLD ? "TASK_ON_HOLD" : "TASK_DONE") << endl;
return state;
}
catch (GeneralException e) {
- cerr << "Task " << GetName() << " caused an unexpected exception. Terminating.\n";
+ cerr << "Task " << GetName() << " caused an unexpected exception: \"" << e.GetMsg() << "\". Terminating.\n";
return TASK_DONE;
}
- cerr << "==== Task: \"" << GetName() << "\" exitted. returning " << (state == TASK_ON_HOLD ? "TASK_ON_HOLD" : "TASK_DONE") << endl;
return state;
}
@@ -51,6 +48,7 @@ void Task::Suspend(int newstate) throw (GeneralException) {
}
void Task::WaitFor(Handle * h, int flags) {
+ h->SetNonBlock();
TaskMan::WaitFor(h, this, flags);
}