From 89a67c7625881a34258d0ff4d5f322061e577d4d Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 15 Feb 2014 19:42:56 -0800 Subject: Potentially avoiding double insert of yielded tasks. --- src/TaskMan.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3