// PARA_INFO_LOG("%s \n", t->status);
if (t->error >= 0)
continue;
+ /*
+ * We have to check whether the list is empty because the call
+ * to ->pre_select() might have called sched_shutdown(). In
+ * this case t has been unregistered already, so we must not
+ * unregister it again.
+ */
+ if (list_empty(&pre_select_list))
+ return;
unregister_task(t);
}
}
// PARA_INFO_LOG("%s: %d\n", t->status, t->ret);
if (t->error >= 0)
continue;
+ /* nec., see sched_preselect() */
+ if (list_empty(&post_select_list))
+ return;
unregister_task(t);
}
}
s->timeout = s->default_timeout;
s->max_fileno = -1;
sched_preselect(s);
+ if (list_empty(&pre_select_list) && list_empty(&post_select_list))
+ return 0;
ret = para_select(s->max_fileno + 1, &s->rfds, &s->wfds, &s->timeout);
if (ret < 0)
return ret;