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 /src/client/qwaylanddisplay_p.h | |
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 'src/client/qwaylanddisplay_p.h')
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 7ba431d7c..ee129a50e 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -108,7 +108,6 @@ public: void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); struct wl_display *wl_display() const { return mDisplay; } - struct wl_event_queue *wl_event_queue() const { return mEventQueue; } struct ::wl_registry *wl_registry() { return object(); } const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } @@ -175,7 +174,6 @@ private: }; struct wl_display *mDisplay; - struct wl_event_queue *mEventQueue; QtWayland::wl_compositor mCompositor; struct wl_shm *mShm; QThread *mEventThread; |