summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-02-15 19:42:56 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-02-15 19:42:56 -0800
commit89a67c7625881a34258d0ff4d5f322061e577d4d (patch)
tree5479ac5acf3b804beafda7d229f5b5243c7c6f50
parentfde54d397fd9d83c50e5cfb5a9244200b1b08615 (diff)
Potentially avoiding double insert of yielded tasks.
-rw-r--r--src/TaskMan.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/TaskMan.cc b/src/TaskMan.cc
index dd4a07a..8e4e941 100644
--- a/src/TaskMan.cc
+++ b/src/TaskMan.cc
@@ -294,7 +294,9 @@ int Balau::TaskMan::mainLoop() {
if ((t->getStatus() == Task::STOPPED) || (t->getStatus() == Task::FAULTED)) {
stopped.insert(t);
} else if (t->getStatus() == Task::YIELDED) {
- yielded.insert(t);
+ taskHash_t::iterator i = yielded.find(t);
+ if (i == yielded.end())
+ yielded.insert(t);
toRemoveFromYielded = false;
}
if (toRemoveFromYielded) {