diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2014-02-15 19:42:56 -0800 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2014-02-15 19:42:56 -0800 |
commit | 89a67c7625881a34258d0ff4d5f322061e577d4d (patch) | |
tree | 5479ac5acf3b804beafda7d229f5b5243c7c6f50 /src | |
parent | fde54d397fd9d83c50e5cfb5a9244200b1b08615 (diff) |
Potentially avoiding double insert of yielded tasks.
Diffstat (limited to 'src')
-rw-r--r-- | src/TaskMan.cc | 4 |
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) { |