dovecot-2.2: Added io_loop_have_immediate_timeouts()

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 5 11:45:44 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/6daf58f568a0
changeset: 15994:6daf58f568a0
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 05 11:45:10 2013 +0200
description:
Added io_loop_have_immediate_timeouts()

diffstat:

 src/lib/ioloop.c |  7 +++++++
 src/lib/ioloop.h |  3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r a2d59816565d -r 6daf58f568a0 src/lib/ioloop.c
--- a/src/lib/ioloop.c	Tue Mar 05 11:24:46 2013 +0200
+++ b/src/lib/ioloop.c	Tue Mar 05 11:45:10 2013 +0200
@@ -665,3 +665,10 @@
 {
 	return ioloop->io_files;
 }
+
+bool io_loop_have_immediate_timeouts(struct ioloop *ioloop)
+{
+	struct timeval tv;
+
+	return io_loop_get_wait_time(ioloop, &tv) == 0;
+}
diff -r a2d59816565d -r 6daf58f568a0 src/lib/ioloop.h
--- a/src/lib/ioloop.h	Tue Mar 05 11:24:46 2013 +0200
+++ b/src/lib/ioloop.h	Tue Mar 05 11:45:10 2013 +0200
@@ -139,5 +139,8 @@
 struct timeout *io_loop_move_timeout(struct timeout **timeout);
 /* Returns TRUE if any IOs have been added to the ioloop. */
 bool io_loop_have_ios(struct ioloop *ioloop);
+/* Returns TRUE if there is a pending timeout that is going to be run
+   immediately. */
+bool io_loop_have_immediate_timeouts(struct ioloop *ioloop);
 
 #endif


More information about the dovecot-cvs mailing list