X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=signal.h;h=d9e98e78a635930577038d6090c9d5260772ddec;hb=82aedc35a6cdf2c7e0d27fc16f75529722505dac;hp=e5532ded5a9378619f7951708b49c5b38bf52d18;hpb=c75c35b176cdacf157d27617e954961c88f33975;p=paraslash.git diff --git a/signal.h b/signal.h index e5532ded..d9e98e78 100644 --- a/signal.h +++ b/signal.h @@ -13,32 +13,31 @@ struct signal_task { }; /** - * A generic pre-select method for signal tasks. + * Monitor the signal fd for reading. * - * \param s Passed to para_fd_set(). + * \param s The scheduler instance. * \param context Signal task pointer. * * This convenience helper is called from several programs which need to handle - * signals, including para_server and para_audiod. These programs define a - * signal task structure and set its ->pre_select method to this function which - * adds the file descriptor of the signal task to the set of descriptors to be - * watched in the next select() call. + * signals, including para_server and para_audiod. These programs set up a + * signal pipe and a signal task structure, and use this function to tell the + * scheduler to monitor the read end of the pipe. * * Although the second parameter must be in fact a pointer to a signal_task - * structure, the parameter is specified as void * here to match the - * ->pre_select method of struct task. + * structure, the parameter is specified as void * here to match the signature + * declared in struct \ref task_info. */ -_static_inline_ void signal_pre_select(struct sched *s, void *context) +_static_inline_ void signal_pre_monitor(struct sched *s, void *context) { struct signal_task *st = context; - para_fd_set(st->fd, &s->rfds, &s->max_fileno); + sched_monitor_readfd(st->fd, s); } struct signal_task *signal_init_or_die(void); void para_sigaction(int sig, void (*handler)(int)); void para_install_sighandler(int); int para_reap_child(pid_t *pid); -int para_next_signal(fd_set *rfds); +int para_next_signal(void); void signal_shutdown(struct signal_task *st); void para_block_signal(int sig); void para_unblock_signal(int sig);