/** Client data associated with the stat task. */
struct client_task *ct;
/** Do not restart client command until this time. */
/** Client data associated with the stat task. */
struct client_task *ct;
/** Do not restart client command until this time. */
-static void signal_setup_default(struct signal_task *st)
-{
- st->task.pre_select = signal_pre_select;
- st->task.post_select = signal_post_select;
- sprintf(st->task.status, "signal task");
-}
-
para_fd_set(ct->fd, &s->rfds, &s->max_fileno);
}
static int command_post_select(struct sched *s, struct task *t)
{
int ret;
para_fd_set(ct->fd, &s->rfds, &s->max_fileno);
}
static int command_post_select(struct sched *s, struct task *t)
{
int ret;
static struct timeval last_status_dump;
struct timeval tmp, delay;
bool force = true;
static struct timeval last_status_dump;
struct timeval tmp, delay;
bool force = true;
- sprintf(ct->task.status, "command task");
+
+ ct->task = task_register(&(struct task_info) {
+ .name = "command",
+ .pre_select = command_pre_select,
+ .post_select = command_post_select,
+ .context = ct,
+ }, &sched);
int i, ret, cafn = stat_task->current_audio_format_num;
if (must_start_decoder())
int i, ret, cafn = stat_task->current_audio_format_num;
if (must_start_decoder())
/* restart the client task if necessary */
static int status_post_select(struct sched *s, struct task *t)
{
/* restart the client task if necessary */
static int status_post_select(struct sched *s, struct task *t)
{
- if (st->ct->task.error >= 0) {
- task_notify(&st->ct->task, E_AUDIOD_OFF);
+ if (st->ct->task->error >= 0) {
+ task_notify(st->ct->task, E_AUDIOD_OFF);
goto out;
}
btr_merge(st->btrn, st->min_iqs);
sz = btr_next_buffer(st->btrn, &buf);
ret = for_each_stat_item(buf, sz, update_item);
if (ret < 0) {
goto out;
}
btr_merge(st->btrn, st->min_iqs);
sz = btr_next_buffer(st->btrn, &buf);
ret = for_each_stat_item(buf, sz, update_item);
if (ret < 0) {
static void init_status_task(struct status_task *st)
{
memset(st, 0, sizeof(struct status_task));
static void init_status_task(struct status_task *st)
{
memset(st, 0, sizeof(struct status_task));
st->sa_time_diff_sign = 1;
st->clock_diff_count = conf.clock_diff_count_arg;
st->current_audio_format_num = -1;
st->sa_time_diff_sign = 1;
st->clock_diff_count = conf.clock_diff_count_arg;
st->current_audio_format_num = -1;
- register_task(&sched, &sig_task->task);
- register_task(&sched, &cmd_task->task);
- register_task(&sched, &stat_task->task);
+ sig_task->task = task_register(&(struct task_info) {
+ .name = "signal",
+ .pre_select = signal_pre_select,
+ .post_select = signal_post_select,
+ .context = sig_task,
+ }, &sched);
+