From 8cc88f4854b72bb270e4b701d15ada7bdbb74ff4 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Wed, 17 Jun 2015 14:48:44 +0300 Subject: Fix possible race condition leading to a dead lock It is a bit dangerous to call wl_display_dispatch() in the event thread, since it may race with the dispatch called e.g. in QWaylandDisplay's blockingReadEvents() and lead to a dead lock. Instead, use wl_display_prepare_read() and wl_display_read_events() in the event thread, which doesn't block, and only dispatch in QWaylandDisplay. As a result we don't need the additional wayland queue anymore, so remove it. Change-Id: I9fbbe5d2f38d06773beb7847df1a0212cca92c37 Reviewed-by: Robin Burchell --- examples/wayland/server-buffer/client/main.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'examples/wayland/server-buffer/client/main.cpp') diff --git a/examples/wayland/server-buffer/client/main.cpp b/examples/wayland/server-buffer/client/main.cpp index 3f7a94d03..1a2c447a7 100644 --- a/examples/wayland/server-buffer/client/main.cpp +++ b/examples/wayland/server-buffer/client/main.cpp @@ -95,7 +95,6 @@ public: QtWaylandClient::QWaylandDisplay *wayland_display = wayland_integration->display(); struct ::wl_registry *registry = wl_display_get_registry(wayland_display->wl_display()); - wl_proxy_set_queue(reinterpret_cast(registry), wayland_display->wl_event_queue()); QtWayland::wl_registry::init(registry); } -- cgit v1.2.3