list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) {
if (t->pre_select)
t->pre_select(s, t);
-// 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);
+ if (t->error < 0)
+ unregister_task(t);
}
}
// PARA_INFO_LOG("%s: %d\n", t->status, t->ret);
if (t->error >= 0)
continue;
- /* nec., see sched_preselect() */
+ /*
+ * We have to check whether the list is empty because the call
+ * to ->post_select() might have called sched_shutdown(). In
+ * this case t has been unregistered already, so we must not
+ * unregister it again.
+ */
if (list_empty(&post_select_list))
return;
unregister_task(t);
* Unregister all tasks.
*
* This will cause \a schedule() to return immediately because both the
- * \a pre_select_list and the \a post_select_list are empty.
+ * \a pre_select_list and the \a post_select_list are empty. This function
+ * must be called from the post_select (rather than the pre_select) method.
*/
void sched_shutdown(void)
{