]> AND Public Git Repository - simgrid.git/blobdiff - examples/simdag/sd_seq_access.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make xbt_os_thread module public (Java needs it, at least)
[simgrid.git] / examples / simdag / sd_seq_access.c
index 786ce2266e66124fda10e0a45ca12c9283667c3d..01b04332610671ff9d24c1d9b2f242d5d5ff8bad 100644 (file)
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
                    &(computation_amount[1]), SD_SCHED_NO_COST, rate);
 
   /* let's launch the simulation! */
-  while (xbt_dynar_length(changed_tasks = SD_simulate(-1.0)) > 0) {
+  while (!xbt_dynar_is_empty(changed_tasks = SD_simulate(-1.0))) {
     for (i = 0; i < 2; i++) {
       task = SD_workstation_get_current_task(workstations[i]);
       if (task)
@@ -116,8 +116,9 @@ int main(int argc, char **argv)
         XBT_ERROR("Shouldn't be here");
       }
     }
-    xbt_dynar_free_container(&changed_tasks);
+    xbt_dynar_free(&changed_tasks);
   }
+  xbt_dynar_free(&changed_tasks);
 
   XBT_DEBUG("Destroying tasks...");