wsi/wl: Fix deadlock in dispatch_queue_timeout.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: a00f9c401b ("loader/wayland: Add fallback wl_display_dispatch_queue_timeout")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27828>
This commit is contained in:
Hans-Kristian Arntzen 2024-02-27 18:55:19 +01:00 committed by Marge Bot
parent a2292f53b5
commit 2d3e7b6e9a

View file

@ -122,6 +122,12 @@ wl_display_dispatch_queue_timeout(struct wl_display *display,
ret = wl_display_dispatch_queue_pending(display, queue);
if (ret != 0)
break;
/* wl_display_dispatch_queue_pending can return 0 if we ended up reading
* from WL fd, but there was no complete event to dispatch yet.
* Try reading again. */
if (wl_display_prepare_read_queue(display, queue) == -1)
return wl_display_dispatch_queue_pending(display, queue);
}
return ret;