[dovecot-cvs] dovecot/src/lib ioloop-epoll.c, 1.11.2.5, 1.11.2.6 ioloop-internal.h, 1.16.2.2, 1.16.2.3 ioloop-kqueue.c, 1.4.2.8, 1.4.2.9 ioloop-poll.c, 1.32.2.2, 1.32.2.3 ioloop-select.c, 1.23, 1.23.2.1 ioloop.c, 1.35.2.8, 1.35.2.9

tss at dovecot.org tss at dovecot.org
Thu Mar 15 16:38:24 EET 2007


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv11821

Modified Files:
      Tag: branch_1_0
	ioloop-epoll.c ioloop-internal.h ioloop-kqueue.c ioloop-poll.c 
	ioloop-select.c ioloop.c 
Log Message:
If poll()/etc. timeouts, we didn't handle time timeouts immediately but
called poll()/etc again with zero timeout and then handled the timeouts.



Index: ioloop-epoll.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-epoll.c,v
retrieving revision 1.11.2.5
retrieving revision 1.11.2.6
diff -u -d -r1.11.2.5 -r1.11.2.6
--- ioloop-epoll.c	7 Nov 2006 13:57:28 -0000	1.11.2.5
+++ ioloop-epoll.c	15 Mar 2007 14:38:21 -0000	1.11.2.6
@@ -172,7 +172,7 @@
 		i_fatal("epoll_wait(): %m");
 
 	/* execute timeout handlers */
-        io_loop_handle_timeouts(ioloop);
+        io_loop_handle_timeouts(ioloop, ret == 0);
 
 	if (!ioloop->running)
 		return;

Index: ioloop-internal.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-internal.h,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -d -r1.16.2.2 -r1.16.2.3
--- ioloop-internal.h	17 Aug 2006 18:46:41 -0000	1.16.2.2
+++ ioloop-internal.h	15 Mar 2007 14:38:21 -0000	1.16.2.3
@@ -51,7 +51,7 @@
 
 int io_loop_get_wait_time(struct timeout *timeout, struct timeval *tv,
 			  struct timeval *tv_now);
-void io_loop_handle_timeouts(struct ioloop *ioloop);
+void io_loop_handle_timeouts(struct ioloop *ioloop, bool update_run_now);
 
 /* call only when timeout->destroyed is TRUE */
 void timeout_destroy(struct ioloop *ioloop, struct timeout **timeout_p);

Index: ioloop-kqueue.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-kqueue.c,v
retrieving revision 1.4.2.8
retrieving revision 1.4.2.9
diff -u -d -r1.4.2.8 -r1.4.2.9
--- ioloop-kqueue.c	3 Nov 2006 14:19:30 -0000	1.4.2.8
+++ ioloop-kqueue.c	15 Mar 2007 14:38:21 -0000	1.4.2.9
@@ -139,7 +139,7 @@
 	}
 
 	/* execute timeout handlers */
-	io_loop_handle_timeouts(ioloop);
+	io_loop_handle_timeouts(ioloop, ret == 0);
 
 	for (i = 0; i < ret; i++) {
 		/* io_loop_handle_add() may cause events array reallocation,

Index: ioloop-poll.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-poll.c,v
retrieving revision 1.32.2.2
retrieving revision 1.32.2.3
diff -u -d -r1.32.2.2 -r1.32.2.3
--- ioloop-poll.c	28 Dec 2006 18:09:06 -0000	1.32.2.2
+++ ioloop-poll.c	15 Mar 2007 14:38:21 -0000	1.32.2.3
@@ -156,7 +156,7 @@
 		i_fatal("poll(): %m");
 
 	/* execute timeout handlers */
-        io_loop_handle_timeouts(ioloop);
+        io_loop_handle_timeouts(ioloop, ret == 0);
 
 	if (ret <= 0 || !ioloop->running) {
                 /* no I/O events */

Index: ioloop-select.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-select.c,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -u -d -r1.23 -r1.23.2.1
--- ioloop-select.c	12 Dec 2005 17:55:04 -0000	1.23
+++ ioloop-select.c	15 Mar 2007 14:38:21 -0000	1.23.2.1
@@ -122,7 +122,7 @@
 		i_warning("select() : %m");
 
 	/* execute timeout handlers */
-        io_loop_handle_timeouts(ioloop);
+        io_loop_handle_timeouts(ioloop, ret == 0);
 
 	if (ret <= 0 || !ioloop->running) {
                 /* no I/O events */

Index: ioloop.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop.c,v
retrieving revision 1.35.2.8
retrieving revision 1.35.2.9
diff -u -d -r1.35.2.8 -r1.35.2.9
--- ioloop.c	15 Mar 2007 14:28:03 -0000	1.35.2.8
+++ ioloop.c	15 Mar 2007 14:38:21 -0000	1.35.2.9
@@ -215,7 +215,7 @@
         return 0;
 }
 
-void io_loop_handle_timeouts(struct ioloop *ioloop)
+void io_loop_handle_timeouts(struct ioloop *ioloop, bool update_run_now)
 {
 	struct timeout *called_timeouts;
 	struct timeval tv;
@@ -253,13 +253,14 @@
 			}
 
 			/* Try again. */
-			io_loop_handle_timeouts(ioloop);
+			io_loop_handle_timeouts(ioloop, TRUE);
 		}
 	}
 
 	ioloop_time = ioloop_timeval.tv_sec;
 
-	if (ioloop->timeouts == NULL || !ioloop->timeouts->run_now)
+	if (ioloop->timeouts == NULL ||
+	    (!ioloop->timeouts->run_now && !update_run_now))
 		return;
 
 	called_timeouts = NULL;



More information about the dovecot-cvs mailing list