From 976d2dfcc90c46c5acba3e310e0125d9a061c381 Mon Sep 17 00:00:00 2001 From: navarro Date: Fri, 9 Mar 2012 14:40:23 +0100 Subject: [PATCH] Fix ns3. --- src/surf/surf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/surf/surf.c b/src/surf/surf.c index a4ef05aa17..b80d1fd389 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -593,14 +593,15 @@ XBT_INLINE double surf_get_clock(void) 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); - 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); - 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) -- 2.20.1