static void log_writer_io_flush_output(gpointer s) { LogWriter *self = (LogWriter *) s; main_loop_assert_main_thread(); log_writer_stop_watches(self); log_pipe_ref(&self->super); if ((self->options->options & LWO_THREADED)) { main_loop_io_worker_job_submit(&self->io_job); } else { /* Checking main_loop_io_worker_job_quit() helps to speed up the * reload process. If reload/shutdown is requested we shouldn't do * anything here, a final flush will be attempted in * log_writer_deinit(). * * Our current understanding is that it doesn't prevent race * conditions of any kind. */ if (!main_loop_io_worker_job_quit()) { log_writer_work_perform(s); log_writer_work_finished(s); } } }
static void log_reader_io_process_input(gpointer s) { LogReader *self = (LogReader *) s; log_reader_stop_watches(self); log_pipe_ref(&self->super.super); if ((self->options->flags & LR_THREADED)) { main_loop_io_worker_job_submit(&self->io_job); } else { /* Checking main_loop_io_worker_job_quit() helps to speed up the * reload process. If reload/shutdown is requested we shouldn't do * anything here, outstanding messages will be processed by the new * configuration. * * Our current understanding is that it doesn't prevent race * conditions of any kind. */ if (!main_loop_io_worker_job_quit()) { log_reader_work_perform(s); log_reader_work_finished(s); } } }
static void _io_process_input(gpointer s) { JournalReader *self = (JournalReader *) s; _stop_watches(self); log_pipe_ref(&self->super.super); if ((self->options->flags & JR_THREADED)) { main_loop_io_worker_job_submit(&self->io_job); } else { if (!main_loop_worker_job_quit()) { _work_perform(s); _work_finished(s); } } }