diff options
author | pixel <pixel> | 2007-04-22 00:34:09 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-04-22 00:34:09 +0000 |
commit | 6ee340fa32c42dfaa69604e67f9848c918675af7 (patch) | |
tree | aa35ec1dc7766321d44e5569a047ad40b8f1ae0a /lib | |
parent | 9255fef52c78ad0fbc457af550e74ca679567773 (diff) |
Fixing timeouts causing issues with task deletions.
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) { |