diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2015-06-17 14:48:44 +0300 |
---|---|---|
committer | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2015-07-06 08:00:02 +0000 |
commit | 8cc88f4854b72bb270e4b701d15ada7bdbb74ff4 (patch) | |
tree | fe7c3ed88fc1d1c469a6e61e104bd12c952b7ab4 /examples/wayland | |
parent | cc694272c201e57e8bffdb770059e51ac998c5f9 (diff) |
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 <robin.burchell@viroteck.net>
Diffstat (limited to 'examples/wayland')
-rw-r--r-- | examples/wayland/server-buffer/client/main.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
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<struct wl_proxy *>(registry), wayland_display->wl_event_queue()); QtWayland::wl_registry::init(registry); } |