- while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
-
- CpuAction* action = static_cast<CpuAction*>(actionHeapPop());
- XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
- if (TRACE_is_enabled()) {
- Cpu* cpu = static_cast<Cpu*>(action->getVariable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), action->getCategory(), action->getVariable()->get_value(),
- action->getLastUpdate(), now - action->getLastUpdate());
- }
-
- action->finish(Action::State::done);
- XBT_CDEBUG(surf_kernel, "Action %p finished", action);
+ while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
+ auto* action = static_cast<CpuAction*>(get_action_heap().pop());
+ XBT_DEBUG("Something happened to action %p", action);