-static int net_action_unref(surf_action_t action)
-{
- action->refcount--;
- if (!action->refcount) {
- xbt_swag_remove(action, action->state_set);
- if (((surf_action_lmm_t)action)->variable) {
- lmm_variable_free(network_maxmin_system,
- ((surf_action_lmm_t) action)->variable);
- }
- if (network_update_mechanism == UM_LAZY) { // remove action from the heap
- surf_action_lmm_heap_remove(net_action_heap,(surf_action_lmm_t) action);
- xbt_swag_remove(action, net_modified_set);
- }
- surf_action_free(&action);
- return 1;
- }
- return 0;
-}
-
-
-
-static void net_action_cancel(surf_action_t action)
-{
- XBT_DEBUG("cancel action %p", action);
- surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
- if (network_update_mechanism == UM_LAZY) { // remove action from the heap
- xbt_swag_remove(action, net_modified_set);
- surf_action_lmm_heap_remove(net_action_heap,(surf_action_lmm_t) action);
- }
-}
-