summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-08 16:59:02 -0700
committerPixel <pixel@nobis-crew.org>2012-04-08 16:59:09 -0700
commitb207b82b663ff05db3872d80b6b9acc831334f31 (patch)
tree556992bd9636deaffb32eb6afcf56604e49a7326
parentca8545b1639f0f33f99b2ce3969874ccc7a79d62 (diff)
Making TaskEvents being able to be re-used for different tasks.
-rw-r--r--src/Task.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Task.cc b/src/Task.cc
index 52e9fa2..f01bb18 100644
--- a/src/Task.cc
+++ b/src/Task.cc
@@ -192,6 +192,7 @@ Balau::Events::TaskEvent::TaskEvent(Task * taskWaited) : m_taskWaited(NULL), m_a
void Balau::Events::TaskEvent::attachToTask(Task * taskWaited) {
AAssert(!m_taskWaited, "You can't attach a TaskEvent twice.");
+ m_ack = false;
m_taskWaited = taskWaited;
ScopeLock lock(m_taskWaited->m_eventLock);
m_taskWaited->m_waitedBy.push_back(this);
@@ -242,6 +243,7 @@ void Balau::Events::TaskEvent::ack() {
IAssert(deleted, "We didn't find task %p in the waitedBy lists... ?", this);
m_ack = true;
reset();
+ m_taskWaited = NULL;
}
void Balau::Events::Timeout::gotOwner(Task * task) {