glib r6788 - in branches/glib-2-16: . glib



Author: tml
Date: Mon Mar 31 08:46:41 2008
New Revision: 6788
URL: http://svn.gnome.org/viewvc/glib?rev=6788&view=rev

Log:
2008-03-31  Tor Lillqvist  <tml novell com>

	Bug 525192 - 100% CPU if run main loop with no IO sources

	* glib/gmain.c (g_poll) [Win32]: Patch by Neil Roberts.



Modified:
   branches/glib-2-16/ChangeLog
   branches/glib-2-16/glib/gmain.c

Modified: branches/glib-2-16/glib/gmain.c
==============================================================================
--- branches/glib-2-16/glib/gmain.c	(original)
+++ branches/glib-2-16/glib/gmain.c	Mon Mar 31 08:46:41 2008
@@ -383,8 +383,14 @@
     }
   else if (nhandles == 0)
     {
-      /* Wait for nothing (huh?) */
-      return 0;
+      /* No handles to wait for, just the timeout */
+      if (timeout == INFINITE)
+	ready = WAIT_FAILED;
+      else
+	{
+	  Sleep (timeout);
+	  ready = WAIT_TIMEOUT;
+	}
     }
   else
     {



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