private bool Iterate()
{
lock(mutex)
{
foreach(CompositeTask task in this.tasks)
{
if(task.IsPending)
{
task.Iterate();
// Always return true here so that we can check the next
// task in the list to see if its done.
return true;
}
}
}
return false;
}