summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-04-22 00:34:09 +0000
committerpixel <pixel>2007-04-22 00:34:09 +0000
commit6ee340fa32c42dfaa69604e67f9848c918675af7 (patch)
treeaa35ec1dc7766321d44e5569a047ad40b8f1ae0a
parent9255fef52c78ad0fbc457af550e74ca679567773 (diff)
Fixing timeouts causing issues with task deletions.
-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) {