X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpoll.c;h=b012ba0350ae94a08d27fbeadf99e73bbb49f541;hb=e4015779cec51757b48977760375f3947d0201bd;hp=8ce68c01548c76749f519dbacf96c1a433cc24aa;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/poll.c b/lib/poll.c index 8ce68c015..b012ba035 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -43,6 +43,7 @@ # include # include # include +# include "msvc-nothrow.h" #else # include # include @@ -452,6 +453,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 +594,12 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) rc++; } + if (!rc && timeout == INFTIM) + { + SwitchToThread(); + goto restart; + } + return rc; #endif }