again:
list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) {
t->pre_select(s, t);
- if (t->ret > 0 || !t->error_handler)
+ if (t->ret > 0 || !t->event_handler)
continue;
- if (t->ret < 0) {
- t->error_handler(t);
- goto again;
- }
- if (!(t->flags & PRE_EOF_IS_ERROR))
- continue;
- t->ret = -E_PRE_EOF;
- t->error_handler(t);
+ t->event_handler(t);
goto again;
}
}
list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) {
t->post_select(s, t);
- if (t->ret > 0 || !t->error_handler)
- continue;
- if (t->ret < 0) {
- t->error_handler(t);
- continue;
- }
- if (!(t->flags & POST_EOF_IS_ERROR))
+ if (t->ret > 0 || !t->event_handler)
continue;
- t->ret = -E_POST_EOF;
- t->error_handler(t);
+ t->event_handler(t);
}
}
void *register_task(struct task *t)
{
- PARA_INFO_LOG("registering task %p\n", t);
+ 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)
void unregister_task(struct task *t)
{
- PARA_INFO_LOG("unregistering task %p\n", t);
+ PARA_INFO_LOG("unregistering %s (%p)\n", t->status, t);
if (t->pre_select)
list_del(&t->pre_select_node);
if (t->post_select)