diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Task.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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) { |