This is going to be called just before running an ioloop iteration.
The next commit improves its behavior.
i_assert(ctx != NULL);
/* get the time left for next timeout task */
- msecs = io_loop_get_wait_time(ioloop, &tv);
+ msecs = io_loop_run_get_wait_time(ioloop, &tv);
events = array_get_modifiable(&ctx->events, &events_count);
if (ioloop->io_files != NULL && events_count > ctx->deleted_count) {
int ret, i, msecs;
/* get the time left for next timeout task */
- msecs = io_loop_get_wait_time(ioloop, &tv);
+ msecs = io_loop_run_get_wait_time(ioloop, &tv);
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000;
bool call;
/* get the time left for next timeout task */
- msecs = io_loop_get_wait_time(ioloop, &tv);
+ msecs = io_loop_run_get_wait_time(ioloop, &tv);
#ifdef _AIX
if (msecs > 1000) {
/* AIX seems to check IO_POLL_ERRORs only at the beginning of
ARRAY(struct ioloop_context_callback) callbacks;
};
-int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
+int io_loop_run_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
void io_loop_handle_timeouts(struct ioloop *ioloop);
void io_loop_call_io(struct io *io);
int ret;
/* get the time left for next timeout task */
- io_loop_get_wait_time(ioloop, &tv);
+ io_loop_run_get_wait_time(ioloop, &tv);
memcpy(&ctx->tmp_read_fds, &ctx->read_fds, sizeof(fd_set));
memcpy(&ctx->tmp_write_fds, &ctx->write_fds, sizeof(fd_set));
return ret;
}
-int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r)
+static int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r)
{
struct timeval tv_now;
struct priorityq_item *item;
return msecs;
}
+int io_loop_run_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r)
+{
+ return io_loop_get_wait_time(ioloop, tv_r);
+}
+
static int timeout_cmp(const void *p1, const void *p2)
{
const struct timeout *to1 = p1, *to2 = p2;