diff options
Diffstat (limited to 'src/eventloop-integration.cpp')
-rw-r--r-- | src/eventloop-integration.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/eventloop-integration.cpp b/src/eventloop-integration.cpp index 0cc65c3..593808a 100644 --- a/src/eventloop-integration.cpp +++ b/src/eventloop-integration.cpp @@ -144,8 +144,12 @@ void BusDispatcher::del_pipe(Pipe *pipe) void BusDispatcher::do_iteration() { - dispatch_pending(); - dispatch(); + dispatch_pending(); + // Only check for events, if there is nothing in the queue. + // TODO: It would be better to just prevent the poll from sleeping + // in this case. + if (!has_something_to_dispatch()) + dispatch(); } Timeout *BusDispatcher::add_timeout(Timeout::Internal *ti) |