|
From: | Paolo Bonzini |
Subject: | Re: lib/poll.c win32 deadlock |
Date: | Wed, 25 Aug 2010 09:24:57 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |