Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix ns3.
authornavarro <navarro@caraja.(none)>
Fri, 9 Mar 2012 13:40:23 +0000 (14:40 +0100)
committernavarro <navarro@caraja.(none)>
Mon, 12 Mar 2012 11:19:39 +0000 (12:19 +0100)
src/surf/surf.c

index a4ef05a..b80d1fd 100644 (file)
@@ -593,14 +593,15 @@ XBT_INLINE double surf_get_clock(void)
 
 static void surf_share_resources(surf_model_t model)
 {
 
 static void surf_share_resources(surf_model_t model)
 {
+  double next_action_end = -1.0;
+  int i = __sync_fetch_and_add(&surf_min_index, 1);
   if (strcmp(model->name,"network NS3")) {
     XBT_DEBUG("Running for Resource [%s]", model->name);
   if (strcmp(model->name,"network NS3")) {
     XBT_DEBUG("Running for Resource [%s]", model->name);
-    double next_action_end = model->model_private->share_resources(NOW);
+    next_action_end = model->model_private->share_resources(NOW);
     XBT_DEBUG("Resource [%s] : next action end = %f",
         model->name, next_action_end);
     XBT_DEBUG("Resource [%s] : next action end = %f",
         model->name, next_action_end);
-    int i = __sync_fetch_and_add(&surf_min_index, 1);
-    surf_mins[i] = next_action_end;
   }
   }
+  surf_mins[i] = next_action_end;
 }
 
 static void surf_update_actions_state(surf_model_t model)
 }
 
 static void surf_update_actions_state(surf_model_t model)