On 08/24/2010 10:58 PM, Erik Faye-Lund wrote:
Hi, after debugging the Win32-emulation of poll a bit more I think I've found another problem with it. If all fds are pipes and have been hanged up and the timeout is -1, poll() stalls infinitely at MsgWaitForMultipleObjects(). That's because there's really nothing for it to wait for, but MsgWaitForMultipleObjects() doesn't know that.
Looks good, but...
+ for (;wait_msg;)
This should be either a "while" or, if wait_msg is invariant (I didn't check) an "if" including the inner infinite "for".
Also, the same check needs to be added for select, even though it's a bit harder because of no explicit POLLHUP flag. Alternatively I'm happy to deprecate the select module, since in general poll(2) is a superior interface.
Paolo