While not great, one way to prevent the wakeup
tree from continuing to add elements after it
has already done so when empty is to add a
boolean flag that's checked to prevent the
addition. For now, we'll live with it
void State::seed_wakeup_tree_if_needed(const odpor::Execution& prior)
{
+ // TODO: It would be better not to have such a flag.
+ if (has_initialized_wakeup_tree) {
+ return;
+ }
// TODO: Note that the next action taken by the actor may be updated
// after it executes. But we will have already inserted it into the
// tree and decided upon "happens-before" at that point for different
wakeup_tree_.insert(prior, odpor::PartialExecution{strategy_->actors_to_run_.at(next).get_transition()});
}
}
+ has_initialized_wakeup_tree = true;
}
void State::sprout_tree_from_parent_state()
* and with respect to this state's sleep set
*/
odpor::WakeupTree wakeup_tree_;
+ bool has_initialized_wakeup_tree = false;
public:
explicit State(RemoteApp& remote_app);