提交 1cfbfaa6 编写于 作者: P Philipp Hahn 提交者: Jim Meyering

python example: poll(-0.001) does not sleep forever

The conversion from seconds to milliseconds should only be done for
actual delays >= 0, not for the magic -1 value used for infinite
timeouts.
Signed-off-by: NPhilipp Hahn <hahn@univention.de>
上级 84eb6eff
......@@ -172,10 +172,10 @@ class virEventLoopPure:
if now >= next:
sleep = 0
else:
sleep = next - now
sleep = (next - now) / 1000.0
self.debug("Poll with a sleep of %d" % sleep)
events = self.poll.poll(sleep / 1000.0)
events = self.poll.poll(sleep)
# Dispatch any file handle events that occurred
for (fd, revents) in events:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册