mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
event-loop: Dispatch idle callbacks twice
To fix a shutdown crash in weston's x11 compositor I want to move the weston X window close to an idle handler. Since idle handlers are processed at the start of an event loop, the handler that deals with window close will run at the start of the next input_loop dispatch, after which the dispatcher blocks on epoll forever (since all input events that will ever occur have been consumed). Dispatching idle callbacks both at the start and end of event-loop processing will prevent this permanent blocking. Note that just moving the callback dispatch could theoretically result in an idle callback being delayed indefinitely while waiting for epoll_wait() to complete. Callbacks are removed from the list when they're run, so the second dispatch won't result in any extra calls. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
parent
7575e2ea19
commit
5ec8062df2
1 changed files with 3 additions and 1 deletions
|
|
@ -421,6 +421,8 @@ wl_event_loop_dispatch(struct wl_event_loop *loop, int timeout)
|
|||
|
||||
wl_event_loop_process_destroy_list(loop);
|
||||
|
||||
wl_event_loop_dispatch_idle(loop);
|
||||
|
||||
do {
|
||||
n = post_dispatch_check(loop);
|
||||
} while (n > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue