[PATCH] event-loop: Only read one epoll event per loop dispatch.
spitzak at gmail.com
Mon Mar 19 11:10:44 PDT 2012
Jonas Ådahl wrote:
> That would not work because ep[i].data.ptr will already be loaded with
> the source pointer pointing to deallocated memory. It doesn't matter
> if that particular source is free:ed and removed from the epoll state
> since it has already been triggered to dispatch. Another approach
> would be to flag an event source for removal if it already has been
> queued up then have the event_loop_dispatch function remove it after
> or instead of handling it.
How about having the data point at another object that points at the
source. This object is not deleted until after the epoll is used, but
when the source is deleted it is set to zero so this is detectable.
More information about the wayland-devel