From: alegrand Date: Wed, 5 Mar 2008 01:51:45 +0000 (+0000) Subject: Bug Fix: The symptom is hard to describe. Sometimes some tasks were not scheduled... X-Git-Tag: v3.3~616 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c3ea1db9e96c5cc786a9918a68cbdad316f71b20 Bug Fix: The symptom is hard to describe. Sometimes some tasks were not scheduled whereas they should have... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5260 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index ee029e07bf..17d7ae5d5f 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -392,7 +392,7 @@ SD_task_t* SD_simulate(double how_long) { double total_time = 0.0; /* we stop the simulation when total_time >= how_long */ double elapsed_time = 0.0; - SD_task_t task, dst; + SD_task_t task, task_safe, dst; SD_dependency_t dependency; surf_action_t action; SD_task_t *changed_tasks = NULL; @@ -421,7 +421,7 @@ SD_task_t* SD_simulate(double how_long) sd_global->watch_point_reached = 0; /* explore the ready tasks */ - xbt_swag_foreach(task, sd_global->ready_task_set) { + xbt_swag_foreach_safe(task, task_safe, sd_global->ready_task_set) { INFO1("Executing task '%s'", SD_task_get_name(task)); if ((task->state_changed = __SD_task_try_to_run(task))) { changed_tasks[changed_task_number++] = task; /* replace NULL by the task */