glib: fix g_poll early timeout on windows
commit0f877b67146fa8cdb1e82c8343d5d77598389eb1
authorSangho Park <sangho1206.park@samsung.com>
Thu, 8 May 2014 08:47:10 +0000 (8 12:47 +0400)
committerStefan Weil <sw@weilnetz.de>
Sat, 10 May 2014 20:40:47 +0000 (10 22:40 +0200)
tree620276866739ec042b7cf756f39f7dd24f390cb6
parent8c8e8879c25cd2013be64bd57ebf2764de6b6534
glib: fix g_poll early timeout on windows

g_poll has a problem on Windows when using
timeouts < 10ms, in glib/gpoll.c:

/* If not, and we have a significant timeout, poll again with
 * timeout then. Note that this will return indication for only
 * one event, or only for messages. We ignore timeouts less than
 * ten milliseconds as they are mostly pointless on Windows, the
 * MsgWaitForMultipleObjectsEx() call will timeout right away
 * anyway.
 */
if (retval == 0 && (timeout == INFINITE || timeout >= 10))
  retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);

so whenever g_poll is called with timeout < 10ms it does
a quick poll instead of wait, this causes significant performance
degradation of QEMU, thus we should use WaitForMultipleObjectsEx
directly

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
include/glib-compat.h
util/oslib-win32.c