- /* if the task was scheduled and dst->tasks_before is empty now, we can make it ready */
- if (xbt_dynar_length(dst->tasks_before) == 0 && __SD_task_is_scheduled(dst))
- __SD_task_set_state(dst, SD_READY);
+ /* if the task was scheduled and dst->tasks_before is empty now, we can make it runnable */
+
+ if (dst->unsatisfied_dependencies == 0){
+ if (__SD_task_is_scheduled(dst))
+ __SD_task_set_state(dst, SD_RUNNABLE);
+ else
+ __SD_task_set_state(dst, SD_SCHEDULABLE);
+ }
+
+ if (dst->is_not_ready == 0)
+ __SD_task_set_state(dst, SD_SCHEDULABLE);