[evolution-data-server/meego-eds] Fix wakeups in imapx parser thread.



commit a293595ac5a812210de29b474a687943cb6bbd2a
Author: David Woodhouse <David Woodhouse intel com>
Date:   Wed Jul 13 18:52:12 2011 -0700

    Fix wakeups in imapx parser thread.
    
    There's no need to wake up every 30 seconds. If the parser_quit flag
    gets set, our cancellable will be cancelled. Fix a race condition in
    imapx_command_idle_stop which was triggering the cancellable and *then*
    setting parser_quit.
    (cherry picked from commit 4cdfe35e77f72e0056c0df188795e4bc20c198b3)

 camel/providers/imapx/camel-imapx-server.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 68baa29..d018028 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2141,9 +2141,9 @@ imapx_command_idle_stop (CamelIMAPXServer *is, GError **error)
 			"Unable to issue DONE");
 		c(printf("Failed to issue DONE to terminate IDLE\n"));
 		is->state = IMAPX_SHUTDOWN;
+		is->parser_quit = TRUE;
 		if (is->op)
 			camel_operation_cancel(is->op);
-		is->parser_quit = TRUE;
 		return FALSE;
 	}
 
@@ -4871,7 +4871,7 @@ imapx_parser_thread (gpointer d)
 			fds[0].events = G_IO_IN;
 			fds[1].fd = camel_operation_cancel_fd (op);
 			fds[1].events = G_IO_IN;
-			res = g_poll(fds, 2, 1000*30);
+			res = g_poll (fds, 2, -1);
 			if (res == -1)
 				g_usleep(1) /* ?? */ ;
 			else if (res == 0)
@@ -4893,7 +4893,7 @@ imapx_parser_thread (gpointer d)
 
 #include <prio.h>
 
-			res = PR_Poll(pollfds, 2, PR_MillisecondsToInterval (30 * 1000));
+			res = PR_Poll(pollfds, 2, PR_INTERVAL_NO_TIMEOUT);
 			if (res == -1)
 				g_usleep(1) /* ?? */ ;
 			else if (res == 0) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]