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;
- 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)
+ if (t->ret > 0 || !t->event_handler)
continue;
- t->error_handler(t);
+ t->event_handler(t);
}
}
int ret;
void (*pre_select)(struct sched *s, struct task *t);
void (*post_select)(struct sched *s, struct task *t);
- void (*error_handler)(struct task *t);
+ void (*event_handler)(struct task *t);
struct list_head pre_select_node;
struct list_head post_select_node;
char status[MAXLINE];
return NULL;
}
-static void idt_error_handler(struct task *t)
+static void idt_event_handler(struct task *t)
{
int ret;
}
}
-static void cwt_error_handler(struct task *t)
+static void cwt_event_handler(struct task *t)
{
if (t->ret != -E_NO_WAV_HEADER && t->ret != -E_WAV_HEADER_SUCCESS) {
PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret));
}
idt.task.pre_select = initial_delay_pre_select;
idt.task.private_data = &idt;
- idt.task.error_handler = idt_error_handler;
+ idt.task.event_handler = idt_event_handler;
sprintf(idt.task.status, "initial_delay");
register_task(&idt.task);
}
-static void stdin_error_handler(struct task *t)
+static void stdin_event_handler(struct task *t)
{
unregister_task(t);
if (t->ret != -E_STDIN_EOF)
sit.loaded = 0,
sit.task.pre_select = stdin_pre_select;
sit.task.post_select = stdin_post_select;
- sit.task.error_handler = stdin_error_handler;
+ sit.task.event_handler = stdin_event_handler;
sit.task.private_data = &sit;
sprintf(sit.task.status, "stdin reader");
register_task(&sit.task);
cwt.task.pre_select = check_wav_pre_select;
cwt.task.private_data = &cwt;
- cwt.task.error_handler = cwt_error_handler;
+ cwt.task.event_handler = cwt_event_handler;
cwt.buf = sit.buf;
cwt.loaded = &sit.loaded;
cwt.eof = &sit.eof;
}
}
-static void wng_error_handler(struct task *t)
+static void wng_event_handler(struct task *t)
{
struct writer_node_group *g = t->private_data;
g->written = para_calloc(num_writers * sizeof(size_t));
g->task.private_data = g;
g->task.post_select = wng_post_select;
- g->task.error_handler = wng_error_handler;
+ g->task.event_handler = wng_event_handler;
g->task.flags = POST_ADD_TAIL;
return g;
}