mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 19:52:10 +01:00
Further patch by Vlad Grecescu: Drop the code path that called
2008-02-26 Tor Lillqvist <tml@novell.com> * glib/gmain.c (g_poll): Further patch by Vlad Grecescu: Drop the code path that called WaitMessage(), as WaitMessage() doesn't offer any chance for APCs to run. Instead just use the code path with MsgWaitForMultipleObjectsEx() even for the wait-only-for-messages case. (#517484) svn path=/trunk/; revision=6597
This commit is contained in:
parent
ec071a4986
commit
d01acfe811
@ -1,3 +1,11 @@
|
|||||||
|
2008-02-26 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gmain.c (g_poll): Further patch by Vlad Grecescu: Drop the
|
||||||
|
code path that called WaitMessage(), as WaitMessage() doesn't
|
||||||
|
offer any chance for APCs to run. Instead just use the code path
|
||||||
|
with MsgWaitForMultipleObjectsEx() even for the
|
||||||
|
wait-only-for--messages case. (#517484)
|
||||||
|
|
||||||
2008-02-25 Matthias Clasen <mclasen@redhat.com>
|
2008-02-25 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* configure.in: Bump version
|
* configure.in: Bump version
|
||||||
|
62
glib/gmain.c
62
glib/gmain.c
@ -328,7 +328,6 @@ g_poll (GPollFD *fds,
|
|||||||
GPollFD *f;
|
GPollFD *f;
|
||||||
DWORD ready;
|
DWORD ready;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
UINT timer;
|
|
||||||
gint nhandles = 0;
|
gint nhandles = 0;
|
||||||
|
|
||||||
for (f = fds; f < &fds[nfds]; ++f)
|
for (f = fds; f < &fds[nfds]; ++f)
|
||||||
@ -363,66 +362,6 @@ g_poll (GPollFD *fds,
|
|||||||
#endif
|
#endif
|
||||||
if (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
|
if (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
|
||||||
ready = WAIT_OBJECT_0 + nhandles;
|
ready = WAIT_OBJECT_0 + nhandles;
|
||||||
else
|
|
||||||
{
|
|
||||||
if (nhandles == 0)
|
|
||||||
{
|
|
||||||
/* Waiting just for messages */
|
|
||||||
if (timeout == INFINITE)
|
|
||||||
{
|
|
||||||
/* Infinite timeout
|
|
||||||
* -> WaitMessage
|
|
||||||
*/
|
|
||||||
#ifdef G_MAIN_POLL_DEBUG
|
|
||||||
g_print ("WaitMessage\n");
|
|
||||||
#endif
|
|
||||||
if (!WaitMessage ())
|
|
||||||
{
|
|
||||||
gchar *emsg = g_win32_error_message (GetLastError ());
|
|
||||||
g_warning (G_STRLOC ": WaitMessage() failed: %s", emsg);
|
|
||||||
g_free (emsg);
|
|
||||||
}
|
|
||||||
ready = WAIT_OBJECT_0 + nhandles;
|
|
||||||
}
|
|
||||||
else if (timeout == 0)
|
|
||||||
{
|
|
||||||
/* Waiting just for messages, zero timeout.
|
|
||||||
* If we got here, there was no message
|
|
||||||
*/
|
|
||||||
ready = WAIT_TIMEOUT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Waiting just for messages, some timeout
|
|
||||||
* -> Set a timer, wait for message,
|
|
||||||
* kill timer, use PeekMessage
|
|
||||||
*/
|
|
||||||
timer = SetTimer (NULL, 0, timeout, NULL);
|
|
||||||
if (timer == 0)
|
|
||||||
{
|
|
||||||
gchar *emsg = g_win32_error_message (GetLastError ());
|
|
||||||
g_warning (G_STRLOC ": SetTimer() failed: %s", emsg);
|
|
||||||
g_free (emsg);
|
|
||||||
ready = WAIT_TIMEOUT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef G_MAIN_POLL_DEBUG
|
|
||||||
g_print ("WaitMessage\n");
|
|
||||||
#endif
|
|
||||||
WaitMessage ();
|
|
||||||
KillTimer (NULL, timer);
|
|
||||||
#ifdef G_MAIN_POLL_DEBUG
|
|
||||||
g_print ("PeekMessage\n");
|
|
||||||
#endif
|
|
||||||
if (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)
|
|
||||||
&& msg.message != WM_TIMER)
|
|
||||||
ready = WAIT_OBJECT_0;
|
|
||||||
else
|
|
||||||
ready = WAIT_TIMEOUT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Wait for either message or event
|
/* Wait for either message or event
|
||||||
@ -442,7 +381,6 @@ g_poll (GPollFD *fds,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (nhandles == 0)
|
else if (nhandles == 0)
|
||||||
{
|
{
|
||||||
/* Wait for nothing (huh?) */
|
/* Wait for nothing (huh?) */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user