struct list_head pre_select_list;
struct list_head post_select_list;
+static struct timeval now_struct;
+struct timeval *now = &now_struct;
+
static void sched_preselect(struct sched *s)
{
struct task *t, *tmp;
int sched(struct sched *s)
{
- gettimeofday(&s->now, NULL);
+ gettimeofday(now, NULL);
again:
FD_ZERO(&s->rfds);
FD_ZERO(&s->wfds);
&s->wfds, &s->timeout);
if (s->select_ret < 0)
return s->select_ret;
- gettimeofday(&s->now, NULL);
+ gettimeofday(now, NULL);
sched_post_select(s);
if (list_empty(&pre_select_list) && list_empty(&post_select_list))
return 0;
PARA_INFO_LOG("registering %s (%p)\n", t->status, t);
if (t->pre_select) {
PARA_DEBUG_LOG("pre_select: %p\n", &t->pre_select);
- if (t->flags & PRE_ADD_TAIL)
- list_add_tail(&t->pre_select_node, &pre_select_list);
- else
- list_add(&t->pre_select_node, &pre_select_list);
+ list_add(&t->pre_select_node, &pre_select_list);
}
if (t->post_select) {
PARA_DEBUG_LOG("post_select: %p\n", &t->pre_select);
- if (t->flags & POST_ADD_TAIL)
- list_add_tail(&t->post_select_node, &post_select_list);
- else
- list_add(&t->post_select_node, &post_select_list);
+ list_add(&t->post_select_node, &post_select_list);
}
return t;
}