ioloop.c revision 6e20d8af0ffb1370df4804c3f02f274754b16e8a
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainenstatic void io_loop_initialize_handler(struct ioloop *ioloop)
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen initial_fd_count = ioloop->max_fd_count > 0 &&
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen ioloop->max_fd_count < IOLOOP_INITIAL_FD_COUNT ?
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen ioloop->max_fd_count : IOLOOP_INITIAL_FD_COUNT;
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen io_loop_handler_init(ioloop, initial_fd_count);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainenstruct io *io_add(int fd, enum io_condition condition,
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen /* if we got here from an I/O handler callback, make sure we
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen don't try to handle this one next. */
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainenstatic void io_remove_full(struct io **_io, bool closed)
8109f3187f5ece5565de1813209af42dc7bb768bTimo Sirainen /* make sure the callback doesn't get called anymore.
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen kqueue code relies on this. */
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen struct io_file *io_file = (struct io_file *)io;
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen i_assert(((*io)->condition & IO_NOTIFY) == 0);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainenstatic void timeout_update_next(struct timeout *timeout, struct timeval *tv_now)
return timeout;
int ret;
return ret;
int msecs;
return msecs;
unsigned int i, count;
for (i = 0; i < count; i++) {
unsigned int t_id;
T_BEGIN {
} T_END;
unsigned int t_id;
void io_loop_time_refresh(void)
return ioloop;
return ctx;
here from activate/deactivate loop */
unsigned int i, count;
for (i = 0; i < count; ) {
return old_io;
return new_io;
return old_to;
return new_to;