continue;
/* action suspended, skip it */
- if (action.suspended_ != 0)
+ if (action.suspended_ != Action::SuspendStates::not_suspended)
continue;
sum_priority += 1.0 / action.getPriority();
continue;
/* verify if the action is really running on cpu */
- if (action.suspended_ == 0 && action.getPriority() > 0) {
+ if (action.suspended_ == Action::SuspendStates::not_suspended && action.getPriority() > 0) {
/* total area needed to finish the action. Used in trace integration */
total_area = (action.getRemains()) * sum_priority * action.getPriority();
continue;
/* action suspended, skip it */
- if (action.suspended_ != 0)
+ if (action.suspended_ != Action::SuspendStates::not_suspended)
continue;
/* action don't need update */
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), 1.0, isOff(), this);
action->setMaxDuration(duration);
- action->suspended_ = 2;
+ action->suspended_ = Action::SuspendStates::sleeping;
if (duration == NO_MAX_DURATION) {
/* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
simgrid::xbt::intrusive_erase(*action->getStateSet(), *action);
void CpuTiAction::suspend()
{
XBT_IN("(%p)", this);
- if (suspended_ != 2) {
- suspended_ = 1;
+ if (suspended_ != Action::SuspendStates::sleeping) {
+ suspended_ = Action::SuspendStates::suspended;
heapRemove(getModel()->getActionHeap());
cpu_->modified(true);
}
void CpuTiAction::resume()
{
XBT_IN("(%p)", this);
- if (suspended_ != 2) {
- suspended_ = 0;
+ if (suspended_ != Action::SuspendStates::sleeping) {
+ suspended_ = Action::SuspendStates::not_suspended;
cpu_->modified(true);
}
XBT_OUT();