sched: Kill old ->post_select variant.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 19:23:18 +0000 (19:23 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:46 +0000 (14:12 +0200)
It has no more users.

41 files changed:
aacdec_filter.c
afh_recv.c
afs.c
alsa_write.c
amp_filter.c
ao_write.c
audioc.c
audiod.c
client.c
client_common.c
compress_filter.c
dccp_recv.c
fecdec_filter.c
file_write.c
filter.c
filter.h
flacdec_filter.c
grab_client.c
http_recv.c
interactive.c
mp3dec_filter.c
oggdec_filter.c
oss_write.c
osx_write.c
play.c
prebuffer_filter.c
recv.c
recv.h
resample_filter.c
sched.c
sched.h
server.c
spxdec_filter.c
stdin.c
stdout.c
udp_recv.c
vss.c
wav_filter.c
wmadec_filter.c
write.h
write_common.c

index 9cea898..71654bf 100644 (file)
@@ -219,6 +219,5 @@ void aacdec_filter_init(struct filter *f)
        f->close = aacdec_close;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = aacdec_post_select;
-       f->post_select = NULL;
        f->execute = aacdec_execute;
 }
index 6eeb08a..aa27c8b 100644 (file)
@@ -253,7 +253,6 @@ void afh_recv_init(struct receiver *r)
        r->close = afh_recv_close;
        r->pre_select = afh_recv_pre_select;
        r->new_post_select = afh_recv_post_select;
-       r->post_select = NULL;
        r->parse_config = afh_recv_parse_config;
        r->free_config = afh_recv_free_config;
        r->execute = afh_execute;
diff --git a/afs.c b/afs.c
index 9daf724..9cc075f 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -762,7 +762,6 @@ static void register_signal_task(struct sched *s)
 
        st->task.pre_select = signal_pre_select;
        st->task.new_post_select = afs_signal_post_select;
-       st->task.post_select = NULL;
        sprintf(st->task.status, "signal task");
        register_task(s, &st->task);
 }
@@ -973,7 +972,6 @@ static void register_command_task(uint32_t cookie, struct sched *s)
 
        ct->task.pre_select = command_pre_select;
        ct->task.new_post_select = command_post_select;
-       ct->task.post_select = NULL;
        sprintf(ct->task.status, "afs command task");
        register_task(s, &ct->task);
 }
index c99f26e..04a94f7 100644 (file)
@@ -358,7 +358,6 @@ void alsa_write_init(struct writer *w)
        w->close = alsa_close;
        w->pre_select = alsa_write_pre_select;
        w->new_post_select = alsa_write_post_select;
-       w->post_select = NULL;
        w->parse_config_or_die = alsa_parse_config_or_die;
        w->free_config = alsa_free_config;
        w->help = (struct ggo_help) {
index 78a70f9..186f87a 100644 (file)
@@ -135,7 +135,6 @@ void amp_filter_init(struct filter *f)
        f->close = amp_close;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = amp_post_select;
-       f->post_select = NULL;
        f->parse_config = amp_parse_config;
        f->free_config = amp_free_config;
        f->help = (struct ggo_help) {
index 3f681eb..65ad02c 100644 (file)
@@ -369,7 +369,6 @@ void ao_write_init(struct writer *w)
        w->close = aow_close;
        w->pre_select = aow_pre_select;
        w->new_post_select = aow_post_select;
-       w->post_select = NULL;
        w->parse_config_or_die = aow_parse_config_or_die;
        w->free_config = aow_free_config;
        w->help = (struct ggo_help) {
index 3cbd8a8..f0c61cd 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -138,7 +138,6 @@ static struct audioc_task audioc_task = {
        .task = {
                .pre_select = audioc_pre_select,
                .new_post_select = audioc_post_select,
-               .post_select = NULL,
                .status = "audioc task"
        },
 }, *at = &audioc_task;
index f412dc6..0ff92e6 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -495,13 +495,7 @@ static void open_filters(struct slot_info *s)
                fn->filter_num = a->filter_nums[i];
                fn->conf = a->filter_conf[i];
                fn->task.pre_select = f->pre_select;
-               if (f->new_post_select) {
-                       fn->task.new_post_select = f->new_post_select;
-                       fn->task.post_select = NULL;
-               } else {
-                       fn->task.new_post_select = NULL;
-                       fn->task.post_select = f->post_select;
-               }
+               fn->task.new_post_select = f->new_post_select;
                fn->btrn = btr_new_node(&(struct btr_node_description)
                        EMBRACE(.name = f->name, .parent = parent,
                                .handler = f->execute, .context = fn));
@@ -565,13 +559,7 @@ static int open_receiver(int format)
        PARA_NOTICE_LOG("started %s: %s receiver in slot %d\n",
                audio_formats[format], r->name, slot_num);
        rn->task.pre_select = r->pre_select;
-       if (r->new_post_select) {
-               rn->task.new_post_select = r->new_post_select;
-               rn->task.post_select = NULL;
-       } else {
-               rn->task.new_post_select = NULL;
-               rn->task.post_select = r->post_select;
-       }
+       rn->task.new_post_select = r->new_post_select;
        sprintf(rn->task.status, "%s receiver node", r->name);
        register_task(&sched, &rn->task);
        return slot_num;
@@ -1022,7 +1010,6 @@ static void signal_setup_default(struct signal_task *st)
 {
        st->task.pre_select = signal_pre_select;
        st->task.new_post_select = signal_post_select;
-       st->task.post_select = NULL;
        sprintf(st->task.status, "signal task");
 }
 
@@ -1056,7 +1043,6 @@ static void init_command_task(struct command_task *ct)
 {
        ct->task.pre_select = command_pre_select;
        ct->task.new_post_select = command_post_select;
-       ct->task.post_select = NULL;
        ct->task.error = 0;
        ct->fd = audiod_get_socket(); /* doesn't return on errors */
        sprintf(ct->task.status, "command task");
@@ -1287,7 +1273,6 @@ static void init_status_task(struct status_task *st)
        memset(st, 0, sizeof(struct status_task));
        st->task.pre_select = status_pre_select;
        st->task.new_post_select = status_post_select;
-       st->task.post_select = NULL;
        st->sa_time_diff_sign = 1;
        st->clock_diff_count = conf.clock_diff_count_arg;
        st->current_audio_format_num = -1;
index 89171a2..da075e0 100644 (file)
--- a/client.c
+++ b/client.c
@@ -96,7 +96,6 @@ static int execute_client_command(const char *cmd, char **result)
                .task = {
                        .pre_select = exec_pre_select,
                        .new_post_select = exec_post_select,
-                       .post_select = NULL,
                        .status = "client exec task",
                },
                .result_buf = para_strdup(""),
@@ -550,7 +549,6 @@ static int supervisor_post_select(struct sched *s, __a_unused struct task *t)
 
 static struct task svt = {
        .new_post_select = supervisor_post_select,
-       .post_select = NULL,
        .status = "supervisor task"
 };
 
index 3e20eaf..8958cac 100644 (file)
@@ -602,7 +602,6 @@ int client_connect(struct client_task *ct, struct sched *s,
                EMBRACE(.name = "client", .parent = parent, .child = child));
        ct->task.pre_select = client_pre_select;
        ct->task.new_post_select = client_post_select;
-       ct->task.post_select = NULL;
        ct->task.error = 0;
        sprintf(ct->task.status, "client");
        register_task(s, &ct->task);
index 85c365c..a10e7c3 100644 (file)
@@ -151,7 +151,6 @@ void compress_filter_init(struct filter *f)
        f->close = compress_close;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = compress_post_select;
-       f->post_select = NULL;
        f->parse_config = compress_parse_config;
        f->free_config = compress_free_config;
        f->help = (struct ggo_help) {
index 7b1f04e..d5f3cad 100644 (file)
@@ -178,7 +178,6 @@ void dccp_recv_init(struct receiver *r)
        r->open = dccp_recv_open;
        r->close = dccp_recv_close;
        r->pre_select = dccp_recv_pre_select;
-       r->post_select = NULL;
        r->new_post_select = dccp_recv_post_select;
        r->parse_config = dccp_recv_parse_config;
        r->free_config = dccp_recv_free_config;
index c65ff89..f1bd885 100644 (file)
@@ -492,5 +492,4 @@ void fecdec_filter_init(struct filter *f)
        f->open = fecdec_open;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = fecdec_post_select;
-       f->post_select = NULL;
 }
index 41298a7..c758dc1 100644 (file)
@@ -154,7 +154,6 @@ void file_write_init(struct writer *w)
        file_write_cmdline_parser_init(&dummy);
        w->pre_select = file_write_pre_select;
        w->new_post_select = file_write_post_select;
-       w->post_select = NULL;
        w->parse_config_or_die = file_write_parse_config_or_die;
        w->free_config = file_write_free_config;
        w->close = file_write_close;
index 07b78ae..7a95b1e 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -140,13 +140,7 @@ int main(int argc, char *argv[])
                        EMBRACE(.name = f->name, .parent = parent,
                        .handler = f->execute, .context = fn));
                fn->task.pre_select = f->pre_select;
-               if (f->new_post_select) {
-                       fn->task.new_post_select = f->new_post_select;
-                       fn->task.post_select = NULL;
-               } else {
-                       fn->task.new_post_select = NULL;
-                       fn->task.post_select = f->post_select;
-               }
+               fn->task.new_post_select = f->new_post_select;
                f->open(fn);
                register_task(&s, &fn->task);
                parent = fn->btrn;
index f737645..31f3ef1 100644 (file)
--- a/filter.h
+++ b/filter.h
@@ -109,8 +109,6 @@ struct filter {
         * post_select function is supposed to set t->error to a (negative)
         * error code.
         */
-       void (*post_select)(struct sched *s, struct task *t);
-       /** New variant, see sched.h. */
        int (*new_post_select)(struct sched *s, struct task *t);
        /**
         * Answer a buffer tree query.
index 363c73b..d739094 100644 (file)
@@ -297,6 +297,5 @@ void flacdec_filter_init(struct filter *f)
        f->close = flacdec_close;
        f->pre_select = flacdec_pre_select;
        f->new_post_select = flacdec_post_select;
-       f->post_select = NULL;
        f->execute = flacdec_execute;
 }
index 3134042..39e9547 100644 (file)
@@ -131,7 +131,6 @@ static void gc_activate(struct grab_client *gc, struct sched *s)
                EMBRACE(.name = name, .parent = parent));
        gc->task.pre_select = gc_pre_select;
        gc->task.new_post_select = gc_post_select;
-       gc->task.post_select = NULL;
        snprintf(gc->task.status, sizeof(gc->task.status) - 1, "%s", name);
        gc->task.status[sizeof(gc->task.status) - 1] = '\0';
        gc->task.error = 0;
index 80f0b16..ad8e213 100644 (file)
@@ -192,7 +192,6 @@ void http_recv_init(struct receiver *r)
        r->open = http_recv_open;
        r->close = http_recv_close;
        r->pre_select = http_recv_pre_select;
-       r->post_select = NULL;
        r->new_post_select = http_recv_post_select;
        r->parse_config = http_recv_parse_config;
        r->free_config = http_recv_free_config;
index 14186cd..cfc1d60 100644 (file)
@@ -448,7 +448,6 @@ int i9e_open(struct i9e_client_info *ici, struct sched *s)
                return ret;
        i9ep->task.pre_select = i9e_pre_select;
        i9ep->task.new_post_select = i9e_post_select;
-       i9ep->task.post_select = NULL;
        sprintf(i9ep->task.status, "i9e");
        register_task(s, &i9ep->task);
        rl_readline_name = "para_i9e";
index 0e8c568..b6e6e36 100644 (file)
@@ -220,7 +220,6 @@ void mp3dec_filter_init(struct filter *f)
        f->free_config = mp3dec_free_config;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = mp3dec_post_select;
-       f->post_select = NULL;
        f->execute = mp3dec_execute;
        f->help = (struct ggo_help) {
                .short_help = mp3dec_filter_args_info_help,
index 791be27..b30abaa 100644 (file)
@@ -273,6 +273,5 @@ void oggdec_filter_init(struct filter *f)
        f->close = ogg_close;
        f->pre_select = ogg_pre_select;
        f->new_post_select = ogg_post_select;
-       f->post_select = NULL;
        f->execute = oggdec_execute;
 }
index 0b8f1b5..8a48b07 100644 (file)
@@ -233,7 +233,6 @@ void oss_write_init(struct writer *w)
        w->close = oss_close;
        w->pre_select = oss_pre_select;
        w->new_post_select = oss_post_select;
-       w->post_select = NULL;
        w->parse_config_or_die = oss_parse_config_or_die;
        w->free_config = oss_free_config;
        w->help = (struct ggo_help) {
index 53e57fa..f961ca5 100644 (file)
@@ -364,7 +364,6 @@ void osx_write_init(struct writer *w)
        w->close = osx_write_close;
        w->pre_select = osx_write_pre_select;
        w->new_post_select = osx_write_post_select;
-       w->post_select = NULL;
        w->parse_config_or_die = osx_write_parse_config_or_die;
        w->free_config = osx_free_config;
        w->help = (struct ggo_help) {
diff --git a/play.c b/play.c
index 50db73a..9639501 100644 (file)
--- a/play.c
+++ b/play.c
@@ -368,13 +368,7 @@ static int open_new_file(struct play_task *pt)
                tmp = NULL;
        }
        pt->rn.task.pre_select = afh_recv->pre_select;
-       if (afh_recv->new_post_select) {
-               pt->rn.task.new_post_select = afh_recv->new_post_select;
-               pt->rn.task.post_select = NULL;
-       } else {
-               pt->rn.task.post_select = NULL;
-               pt->rn.task.new_post_select = afh_recv->new_post_select;
-       }
+       pt->rn.task.new_post_select = afh_recv->new_post_select;
        sprintf(pt->rn.task.status, "%s receiver node", afh_recv->name);
        return 1;
 fail:
@@ -415,13 +409,7 @@ static int load_file(struct play_task *pt)
        pt->fn.filter_num = ret;
        decoder = filters + ret;
        pt->fn.task.pre_select = decoder->pre_select;
-       if (decoder->new_post_select) {
-               pt->fn.task.new_post_select = decoder->new_post_select;
-               pt->fn.task.post_select = NULL;
-       } else {
-               pt->fn.task.new_post_select = NULL;
-               pt->fn.task.post_select = decoder->post_select;
-       }
+       pt->fn.task.new_post_select = decoder->new_post_select;
        sprintf(pt->fn.task.status, "%s decoder", af);
        pt->fn.btrn = btr_new_node(&(struct btr_node_description)
                EMBRACE(.name = decoder->name, .parent = pt->rn.btrn,
@@ -1283,7 +1271,6 @@ int main(int argc, char *argv[])
        pt->playing = true;
        pt->task.pre_select = play_pre_select;
        pt->task.new_post_select = play_post_select;
-       pt->task.post_select = NULL;
        sprintf(pt->task.status, "play task");
        register_task(&sched, &pt->task);
        ret = schedule(&sched);
index c849424..5ccfa45 100644 (file)
@@ -123,7 +123,6 @@ void prebuffer_filter_init(struct filter *f)
        f->free_config = prebuffer_free_config;
        f->pre_select = prebuffer_pre_select;
        f->new_post_select = prebuffer_post_select;
-       f->post_select = NULL;
        f->help = (struct ggo_help) {
                .short_help = prebuffer_filter_args_info_help,
                .detailed_help = prebuffer_filter_args_info_detailed_help
diff --git a/recv.c b/recv.c
index 4458021..e46fa1a 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -109,13 +109,7 @@ int main(int argc, char *argv[])
        register_task(&s, &sot.task);
 
        rn.task.pre_select = r->pre_select;
-       if (r->new_post_select) {
-               rn.task.new_post_select = r->new_post_select;
-               rn.task.post_select = NULL;
-       } else {
-               rn.task.new_post_select = NULL;
-               rn.task.post_select = r->post_select;;
-       }
+       rn.task.new_post_select = r->new_post_select;
        sprintf(rn.task.status, "%s", r->name);
        register_task(&s, &rn.task);
 
diff --git a/recv.h b/recv.h
index c48a6b3..6222b93 100644 (file)
--- a/recv.h
+++ b/recv.h
@@ -115,8 +115,6 @@ struct receiver {
         *
         * \sa select(2), struct receiver.
         */
-       void (*post_select)(struct sched *s, struct task *t);
-       /** New variant, see sched.h. */
        int (*new_post_select)(struct sched *s, struct task *t);
 
        /** The two help texts of this receiver. */
index 383332b..2055f69 100644 (file)
@@ -307,7 +307,6 @@ void resample_filter_init(struct filter *f)
        f->open = resample_open;
        f->pre_select = resample_pre_select;
        f->new_post_select = resample_post_select;
-       f->post_select = NULL;
        f->parse_config = resample_parse_config;
        f->free_config = resample_free_config;
        f->execute = resample_execute;
diff --git a/sched.c b/sched.c
index 2501b50..50e87b5 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -36,7 +36,7 @@ static void unregister_task(struct task *t)
                para_strerror(-t->error));
        if (t->pre_select)
                list_del(&t->pre_select_node);
-       if (t->new_post_select || t->post_select)
+       if (t->new_post_select)
                list_del(&t->post_select_node);
 }
 
@@ -62,20 +62,13 @@ static void sched_preselect(struct sched *s)
 static inline void call_post_select(struct sched *s, struct task *t)
 {
 #ifndef SCHED_DEBUG
-       if (t->new_post_select) {
-               t->error = t->new_post_select(s, t);
-               return;
-       }
-       return t->post_select(s, t);
+       t->error = t->new_post_select(s, t);
 #else
        struct timeval t1, t2, diff;
        unsigned long pst;
 
        clock_get_realtime(&t1);
-       if (t->new_post_select)
-               t->error = t->new_post_select(s, t);
-       else
-               t->post_select(s, t);
+       t->error = t->new_post_select(s, t);
        clock_get_realtime(&t2);
        tv_diff(&t1, &t2, &diff);
        pst = tv2ms(&diff);
@@ -175,9 +168,6 @@ void register_task(struct sched *s, struct task *t)
        if (t->new_post_select) {
                PARA_DEBUG_LOG("post_select: %p\n", &t->new_post_select);
                list_add_tail(&t->post_select_node, &s->post_select_list);
-       } else if ((t->post_select)) {
-               PARA_DEBUG_LOG("post_select: %p\n", &t->post_select);
-               list_add_tail(&t->post_select_node, &s->post_select_list);
        }
 }
 
diff --git a/sched.h b/sched.h
index 907e5fb..da20e30 100644 (file)
--- a/sched.h
+++ b/sched.h
@@ -54,12 +54,6 @@ struct task {
         * scheduler and to decrease the select timeout if necessary.
         */
        void (*pre_select)(struct sched *s, struct task *t);
-       /**
-        * The postselect hook of \a t.
-        *
-        * Evaluate and act upon the results of the previous select call.
-        */
-       void (*post_select)(struct sched *s, struct task *t);
        /**
         * The newer variant of the post select hook of \a t.
         *
index 8ad2ccb..e963da7 100644 (file)
--- a/server.c
+++ b/server.c
@@ -339,7 +339,6 @@ static void init_signal_task(void)
 
        st->task.pre_select = signal_pre_select;
        st->task.new_post_select = signal_post_select;
-       st->task.post_select = NULL;
        sprintf(st->task.status, "signal task");
 
        PARA_NOTICE_LOG("setting up signal handling\n");
@@ -424,7 +423,6 @@ static void init_server_command_task(int argc, char **argv)
        PARA_NOTICE_LOG("initializing tcp command socket\n");
        sct->task.pre_select = command_pre_select;
        sct->task.new_post_select = command_post_select;
-       sct->task.post_select = NULL;
        sct->argc = argc;
        sct->argv = argv;
        ret = para_listen_simple(IPPROTO_TCP, conf.port_arg);
index 3bf547e..e9c6df1 100644 (file)
@@ -305,6 +305,5 @@ void spxdec_filter_init(struct filter *f)
        f->close = speexdec_close;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = speexdec_post_select;
-       f->post_select = NULL;
        f->execute = speexdec_execute;
 }
diff --git a/stdin.c b/stdin.c
index b52123d..ccd4487 100644 (file)
--- a/stdin.c
+++ b/stdin.c
@@ -101,7 +101,6 @@ void stdin_set_defaults(struct stdin_task *sit)
 
        sit->task.pre_select = stdin_pre_select;
        sit->task.new_post_select = stdin_post_select;
-       sit->task.post_select = NULL;
        sit->btrp = btr_pool_new("stdin", 128 * 1024);
        sprintf(sit->task.status, "stdin reader");
        ret = mark_fd_nonblocking(STDIN_FILENO);
index 92707ba..a0bbeb3 100644 (file)
--- a/stdout.c
+++ b/stdout.c
@@ -90,7 +90,6 @@ void stdout_set_defaults(struct stdout_task *sot)
 
        sot->task.pre_select = stdout_pre_select;
        sot->task.new_post_select = stdout_post_select;
-       sot->task.post_select = NULL;
        sprintf(sot->task.status, "stdout");
        ret = mark_fd_nonblocking(STDOUT_FILENO);
        if (ret >= 0)
index 4707869..27a392d 100644 (file)
@@ -223,7 +223,6 @@ void udp_recv_init(struct receiver *r)
        r->open = udp_recv_open;
        r->close = udp_recv_close;
        r->pre_select = udp_recv_pre_select;
-       r->post_select = NULL;
        r->new_post_select = udp_recv_post_select;
        r->parse_config = udp_recv_parse_config;
        r->free_config = udp_recv_free_config;
diff --git a/vss.c b/vss.c
index 5b8c687..e643805 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -1175,7 +1175,6 @@ void init_vss_task(int afs_socket, struct sched *s)
        vsst->afs_socket = afs_socket;
        vsst->task.pre_select = vss_pre_select;
        vsst->task.new_post_select = vss_post_select;
-       vsst->task.post_select = NULL;
        ms2tv(announce_time, &vsst->announce_tv);
        PARA_INFO_LOG("announce timeval: %lums\n", tv2ms(&vsst->announce_tv));
        INIT_LIST_HEAD(&fec_client_list);
index ccf923e..c2a9329 100644 (file)
@@ -132,5 +132,4 @@ void wav_filter_init(struct filter *f)
        f->open = wav_open;
        f->pre_select = wav_pre_select;
        f->new_post_select = wav_post_select;
-       f->post_select = NULL;
 }
index 1beeb5a..e4592dd 100644 (file)
@@ -1286,5 +1286,4 @@ void wmadec_filter_init(struct filter *f)
        f->execute = wmadec_execute;
        f->pre_select = generic_filter_pre_select;
        f->new_post_select = wmadec_post_select;
-       f->post_select = NULL;
 }
diff --git a/write.h b/write.h
index bac9443..896f974 100644 (file)
--- a/write.h
+++ b/write.h
@@ -65,8 +65,6 @@ struct writer {
         *
         * Called from the post_select function of the writer node's task.
         */
-       void (*post_select)(struct sched *s, struct task *t);
-       /** New variant, see sched.h. */
        int (*new_post_select)(struct sched *s, struct task *t);
        /**
         * Close one instance of the writer.
index a1aac65..db4374f 100644 (file)
@@ -114,13 +114,7 @@ void register_writer_node(struct writer_node *wn, struct btr_node *parent,
        strcpy(wn->task.status, name);
        free(name);
        wn->task.pre_select = w->pre_select;
-       if (w->new_post_select) {
-               wn->task.new_post_select = w->new_post_select;
-               wn->task.post_select = NULL;
-       } else {
-               wn->task.new_post_select = NULL;
-               wn->task.post_select = w->post_select;
-       }
+       wn->task.new_post_select = w->new_post_select;
        register_task(s, &wn->task);
 }