summaryrefslogtreecommitdiff
path: root/src/Task.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-08-13 05:43:00 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-08-13 05:47:43 +0200
commit735604976485ab69cd813d13ef53505bc454c201 (patch)
treedbec4f89a031316f73bba9460795bc21268ddbd9 /src/Task.cc
parentf6bb2cd9acaaeaae1d72edc49d321507f6893f8e (diff)
Fixing rare multithreading crash.
-) Make sure to acquire the eventLock when possibly deleting a Task. -) Keep the lock until we're done with it.
Diffstat (limited to 'src/Task.cc')
-rw-r--r--src/Task.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Task.cc b/src/Task.cc
index a4ec5bc..b294fa9 100644
--- a/src/Task.cc
+++ b/src/Task.cc
@@ -250,8 +250,9 @@ void Balau::Events::TaskEvent::ack() {
break;
}
}
- t->m_eventLock.leave();
Printer::elog(E_TASK, "TaskEvent at %p being ack; removing from the 'waited by' list of %p (%s - %s); deleted = %s", this, t, t->getName(), ClassName(t).c_str(), deleted ? "true" : "false");
+ t->m_eventLock.leave();
+ t = NULL;
IAssert(deleted, "We didn't find task %p in the waitedBy lists... ?", this);
m_ack = true;
reset();