From dcb9fab8463996542d06d29bc383f5933bf0d677 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 11 Feb 2012 11:34:36 -0800 Subject: EventLoop: shorten iteration poll if timeouts This fixes EventLoop.iteration() so that it doesn't poll too long when there are timeouts registered, since it's not nice to spend a long time polling for an IO event that might never arrive even though a timeout may have changed some state that would terminate a timeout loop like in QueueScheduler.run() or AbstractPollTask._wait_loop(). This makes EventLoop.iteration() behave more like GlibEventLoop.iteration(). --- pym/portage/util/_eventloop/EventLoop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pym/portage/util/_eventloop') diff --git a/pym/portage/util/_eventloop/EventLoop.py b/pym/portage/util/_eventloop/EventLoop.py index 02c3cec01..a7161dbd5 100644 --- a/pym/portage/util/_eventloop/EventLoop.py +++ b/pym/portage/util/_eventloop/EventLoop.py @@ -166,7 +166,7 @@ class EventLoop(object): if not self._poll_event_queue: if may_block: - timeout = None + timeout = self._timeout_interval else: timeout = 0 self._poll(timeout=timeout) -- cgit v1.2.3-1-g7c22