summaryrefslogtreecommitdiff
path: root/glib/gpoll.c
diff options
context:
space:
mode:
authormajordaw <major.david@balasys.hu>2020-05-20 15:30:57 +0200
committermajordaw <major.david@balasys.hu>2020-05-20 15:32:47 +0200
commit26991b609389f85ff5dac5cffedc8d5ba1b2615c (patch)
tree79cf59a99086d36d80b473a4171cbe3748cab278 /glib/gpoll.c
parente816e9c86f54a1307235893c1f7cbc309281ee25 (diff)
downloadglib-26991b609389f85ff5dac5cffedc8d5ba1b2615c.tar.gz
win32 gpoll: Fix wait for at least one thread to return
When timeout grater than 0 in g_poll function, the WaitForMultipleObjects call will wait for all the threads to return, but when only one thread got an event the others will sleep until the timeout elapses, and causes a stall. Triggering the stop event in g_poll in this case is useless as it is triggered when all the threads where already signaled or timed-out. Closes: https://gitlab.gnome.org/GNOME/glib/issues/2107
Diffstat (limited to 'glib/gpoll.c')
-rw-r--r--glib/gpoll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gpoll.c b/glib/gpoll.c
index 290c64c3c..2681d91f9 100644
--- a/glib/gpoll.c
+++ b/glib/gpoll.c
@@ -450,7 +450,7 @@ g_poll (GPollFD *fds,
ready = MsgWaitForMultipleObjectsEx (nthreads, thread_handles, timeout,
QS_ALLINPUT, MWMO_ALERTABLE);
else
- ready = WaitForMultipleObjects (nthreads, thread_handles, timeout > 0, timeout);
+ ready = WaitForMultipleObjects (nthreads, thread_handles, FALSE, timeout);
/* Signal the stop in case any of the threads did not stop yet */
if (!SetEvent ((HANDLE)stop_event.fd))