X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fpoll.c;h=e06456581b5d8163e320b56e55195182e5ad9bc7;hb=17f0ec6;hp=8ce68c01548c76749f519dbacf96c1a433cc24aa;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/poll.c b/lib/poll.c index 8ce68c015..e06456581 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -452,6 +452,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) if (!hEvent) hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); +restart: handle_array[0] = hEvent; nhandles = 1; FD_ZERO (&rfds); @@ -592,6 +593,12 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) rc++; } + if (!rc && timeout == INFTIM) + { + SwitchToThread(); + goto restart; + } + return rc; #endif }