summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Task.h1
-rw-r--r--lib/Task.cc9
2 files changed, 9 insertions, 1 deletions
diff --git a/include/Task.h b/include/Task.h
index 414ffa7..12c0587 100644
--- a/include/Task.h
+++ b/include/Task.h
@@ -67,6 +67,7 @@ class Task : public Base {
bool stopped;
bool suspended;
Task * wbta;
+ Task * wta;
};
#endif
diff --git a/lib/Task.cc b/lib/Task.cc
index 5a8def0..5d48404 100644
--- a/lib/Task.cc
+++ b/lib/Task.cc
@@ -10,13 +10,17 @@
#include "BString.h"
#include "gettext.h"
-Task::Task() : current(0), state(TASK_ON_HOLD), stopped(false), suspended(false), wbta(0), BurstHandle(0) {
+Task::Task() : current(0), state(TASK_ON_HOLD), stopped(false), suspended(false), wbta(0), wta(0), BurstHandle(0) {
TaskMan::AddTask(this);
}
Task::~Task() {
TaskMan::RemoveFromWatches(this);
TaskMan::RemoveTimeout(this);
+ if (wbta)
+ wbta->wta = 0;
+ if (wta)
+ wta->wbta = 0;
}
int Task::Do() throw (GeneralException) {
@@ -24,6 +28,8 @@ int Task::Do() throw (GeneralException) {
}
int Task::Run() {
+ if (TaskMan::Event() == Task::EVT_TASK)
+ wta = 0;
try {
state = Do();
}
@@ -78,6 +84,7 @@ void Task::WaitFor(Handle * h, int flags) {
void Task::WaitFor(Task * t) {
t->wbta = this;
+ wta = t;
}
void Task::WaitFor(pid_t p) {