summaryrefslogtreecommitdiff
path: root/lib/Task.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Task.cc')
-rw-r--r--lib/Task.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Task.cc b/lib/Task.cc
index 42147d3..c34d0e3 100644
--- a/lib/Task.cc
+++ b/lib/Task.cc
@@ -12,16 +12,19 @@ int Task::Do() {
int Task::Run() {
cerr << "Running task '" << GetName() << "'...\n";
try {
+ cerr << "Launching method Do()...\n";
state = Do();
}
catch (TaskSwitch) {
- Resume(1);
+ cerr << "Catch a task switching.\n";
throw;
}
catch (GeneralException e) {
cerr << "Task " << GetName() << " caused an unexpected exception: '" << e.GetMsg() << "', closing it.\n";
return TASK_DONE;
}
+
+ cerr << "Task exitted normally.\n";
return state;
}
@@ -49,8 +52,8 @@ int Task::Suspend() throw (GeneralException) {
}
void Task::Resume(int val) throw (GeneralException) {
+ cerr << "Resuming task " << GetName() << "...\n";
if (suspended) {
- cerr << "Resuming task " << GetName() << "...\n";
suspended = false;
longjmp(env, val);
} else {