]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/network_constant.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added the weight model improvements to lagrange models.
[simgrid.git] / src / surf / network_constant.c
index 8316e17168c369d5c4e443acbebf17d2d3aca4ee..1f06f331dd36fd8c99e99940243114384010bd18 100644 (file)
@@ -102,8 +102,8 @@ static int resource_used(void *resource_id)
 
 static int action_free(surf_action_t action)
 {
-  action->using--;
-  if (!action->using) {
+  action->refcount --;
+  if (!action->refcount ) {
     xbt_swag_remove(action, action->state_set);
     free(action);
     return 1;
@@ -113,7 +113,7 @@ static int action_free(surf_action_t action)
 
 static void action_use(surf_action_t action)
 {
-  action->using++;
+  action->refcount ++;
 }
 
 static void action_cancel(surf_action_t action)
@@ -203,7 +203,7 @@ static surf_action_t communicate(void *src, void *dst, double size,
 
   action = xbt_new0(s_surf_action_network_Constant_t, 1);
 
-  action->generic_action.using = 1;
+  action->generic_action.refcount  = 1;
   action->generic_action.cost = size;
   action->generic_action.remains = size;
   action->generic_action.max_duration = NO_MAX_DURATION;