event-loop: Add an optional post-dispatch source callout
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 21 Apr 2011 18:41:48 +0000 (14:41 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 21 Apr 2011 18:46:12 +0000 (14:46 -0400)
commit589e581f76ef5aaa29499abaa82703745b69f7d5
tree5259d1e6c9cbdc73a42a2ad276abb53496b21262
parent13ca93794405965cac8d3e3173f3f4eda2ff28c6
event-loop: Add an optional post-dispatch source callout

This lets a source mark itself as ready to dispatch even though the fd
didn't trigger.   What can happen is that for the X11 socket, some other
source callback (the drm fd or a wayland client socket) can cause somebody
to do an X roundtrip (DRI2 get buffers, for example) and queue up events
in the xcb buffer.  When we get back to epoll, the X fd no longer polls
readable and we don't process those events until we get another X event.

The check callback is called after a round of dispatching and lets a source
check if it has data to dispatch and mark itself ready.  Next round of
dispatching will then process it immediately instead of blocking in
epoll_wait().
wayland/event-loop.c
wayland/wayland-server.h