From: Tor Lillqvist Date: Mon, 31 Mar 2008 07:37:17 +0000 (+0000) Subject: Bug 525192 - 100% CPU if run main loop with no IO sources X-Git-Tag: GLIB_2_17_0~115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e877f984e55becb2f2df7977887fd812cd39c17;p=platform%2Fupstream%2Fglib.git Bug 525192 - 100% CPU if run main loop with no IO sources 2008-03-31 Tor Lillqvist Bug 525192 - 100% CPU if run main loop with no IO sources * glib/gmain.c (g_poll) [Win32]: Patch by Neil Roberts. svn path=/trunk/; revision=6787 --- diff --git a/ChangeLog b/ChangeLog index e81e33d..886bc9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-31 Tor Lillqvist + + Bug 525192 - 100% CPU if run main loop with no IO sources + + * glib/gmain.c (g_poll) [Win32]: Patch by Neil Roberts. + 2008-03-30 Matthias Clasen * glib/gtester.c: Don't use ARG_MAX. (#522335, patch by diff --git a/glib/gmain.c b/glib/gmain.c index 93ae009..d833efc 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -383,8 +383,14 @@ g_poll (GPollFD *fds, } 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 {