# HG changeset patch # User Erik Faye-Lund # Date 1309947051 -7200 # Node ID f3753e923660f279498434857749c8b7d672f60c # Parent c089b67729fea118d59ab6b3bd2668b0b2676453 poll: do not return 0 on timeout=-1 * lib/poll.c: Loop with yield if no events occured diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-06 Erik Faye-Lund + + poll: do not return 0 on timeout=-1 + * lib/poll.c: Loop with yield if no events occured + 2011-07-06 Eric Blake pthread_sigmask: always replace when not using pthread diff --git a/lib/poll.c b/lib/poll.c --- a/lib/poll.c +++ b/lib/poll.c @@ -452,6 +452,7 @@ if (!hEvent) hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); +restart: handle_array[0] = hEvent; nhandles = 1; FD_ZERO (&rfds); @@ -592,6 +593,12 @@ rc++; } + if (!rc && timeout == INFTIM) + { + SwitchToThread(); + goto restart; + } + return rc; #endif }