mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-06 04:40:05 +02:00
W32: Do not ignore short waits in g_poll
Do the actual wait dance even if wait timeout is < 10ms. Otherwise we might busyloop. https://bugzilla.gnome.org/show_bug.cgi?id=764415
This commit is contained in:
parent
55ab3af098
commit
210a9796f7
@ -303,12 +303,9 @@ g_poll (GPollFD *fds,
|
|||||||
|
|
||||||
/* If not, and we have a significant timeout, poll again with
|
/* If not, and we have a significant timeout, poll again with
|
||||||
* timeout then. Note that this will return indication for only
|
* timeout then. Note that this will return indication for only
|
||||||
* one event, or only for messages. We ignore timeouts less than
|
* one event, or only for messages.
|
||||||
* ten milliseconds as they are mostly pointless on Windows, the
|
|
||||||
* MsgWaitForMultipleObjectsEx() call will timeout right away
|
|
||||||
* anyway.
|
|
||||||
*/
|
*/
|
||||||
if (retval == 0 && (timeout == INFINITE || timeout >= 10))
|
if (retval == 0 && (timeout == INFINITE || timeout > 0))
|
||||||
retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);
|
retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user