action->set_max_duration(duration);
action->suspended_ = kernel::resource::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->get_state_set(), *action);
action->set_max_duration(duration);
action->suspended_ = kernel::resource::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->get_state_set(), *action);