/** \file sched.c Paraslash's scheduling functions. */
+#include <regex.h>
#include <dirent.h> /* readdir() */
#include <assert.h>
#include <sys/time.h>
if (t->post_select)
list_del(&t->post_select_node);
t->error = -E_TASK_UNREGISTERED;
-};
+}
static void sched_preselect(struct sched *s)
{
struct task *t, *tmp;
list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) {
- if (t->error >= 0)
+ if (t->error >= 0 && t->pre_select)
t->pre_select(s, t);
// PARA_INFO_LOG("%s \n", t->status);
if (t->error >= 0)
INIT_LIST_HEAD(&pre_select_list);
INIT_LIST_HEAD(&post_select_list);
initialized = 1;
-};
+}
/**
* Add a task to the scheduler.
list_add_tail(&t->pre_select_node, &pre_select_list);
}
if (t->post_select) {
- PARA_DEBUG_LOG("post_select: %p\n", &t->pre_select);
+ PARA_DEBUG_LOG("post_select: %p\n", &t->post_select);
list_add_tail(&t->post_select_node, &post_select_list);
}
}
list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node)
unregister_task(t);
initialized = 0;
-};
+}
/**
* Get the list of all registered tasks.