if (s->format < 0)
return;
- if (s->receiver_node && s->receiver_node->task.error != -E_TASK_UNREGISTERED)
+ if (s->receiver_node && s->receiver_node->task.error >= 0)
return;
for (i = 0; i < a->num_filters; i++)
- if (s->fns && s->fns[i].task.error != -E_TASK_UNREGISTERED)
+ if (s->fns && s->fns[i].task.error >= 0)
return;
if (a->num_writers > 0) {
for (i = 0; i < a->num_writers; i++)
- if (s->wns && s->wns[i].task.error != -E_TASK_UNREGISTERED)
+ if (s->wns && s->wns[i].task.error >= 0)
return;
} else {
- if (s->wns && s->wns[0].task.error != -E_TASK_UNREGISTERED)
+ if (s->wns && s->wns[0].task.error >= 0)
return;
}
PARA_INFO_LOG("closing slot %d\n", slot_num);
kill_btrn(st->ct->btrn, &st->ct->task, -E_AUDIOD_OFF);
goto out;
}
- if (st->ct->task.error != -E_TASK_UNREGISTERED)
+ if (st->ct->task.error >= 0)
goto out;
close_stat_pipe();
st->clock_diff_count = conf.clock_diff_count_arg;
size_t sz;
int ret;
if (st->ct->task.error < 0) {
- if (st->ct->task.error != -E_TASK_UNREGISTERED)
+ if (st->ct->task.error >= 0)
goto out;
close_stat_pipe();
goto out;
#define SCHED_ERRORS \
PARA_ERROR(TASK_KILLED, "task killed"), \
- PARA_ERROR(TASK_UNREGISTERED, "task has been unscheduled"), \
PARA_ERROR(NO_SUCH_TASK, "task not found"), \
PARA_ERROR(NOT_INITIALIZED, "scheduler not yet initialized"), \
+ PARA_ERROR(SCHED_SHUTDOWN, "scheduler was shut down"), \
#define NET_ERRORS \
struct grab_client *gc, *tmp;
list_for_each_entry_safe(gc, tmp, &inactive_grab_client_list, node) {
- if (gc->task.error == -E_TASK_UNREGISTERED) {
+ if (gc->task.error < 0) {
list_del(&gc->node);
free(gc);
continue;
{
if (!initialized)
return;
+ assert(t->error < 0);
PARA_INFO_LOG("unregistering %s (%s)\n", t->status,
- t->error <0? para_strerror(-t->error) : "shutdown");
+ para_strerror(-t->error));
if (t->pre_select)
list_del(&t->pre_select_node);
if (t->post_select)
list_del(&t->post_select_node);
- t->error = -E_TASK_UNREGISTERED;
}
-
static void sched_preselect(struct sched *s)
{
struct task *t, *tmp;
if (!initialized)
return;
- list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node)
+ list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) {
+ t->error = -E_SCHED_SHUTDOWN;
unregister_task(t);
- list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node)
+ }
+ list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) {
+ t->error = -E_SCHED_SHUTDOWN;
unregister_task(t);
+ }
initialized = 0;
}