Fix : cb_pre_handle_data()
When there are any events remain in wayland event list, they
are going to be dispatched through wl_display_dispatch_pending().
By the way, if there is any error set in last_error in ewd->wl.display,
wl_display_dispatch_pending() will be failed and we must return directly
, unless ewd->prepare_read will be set true, wl_display_read_events()
will be called in _ecore_wl_cb_awake(). Calling wl_display_read_events()
without wl_display_prepare_read() will cause a deadlock in multi-threaded
wayland client.
Fix : cb_awake()
When there is an error on wayland display socket fd, _ecore_wl_cb_wake()
will also be called. Now when a error comes to _ecore_wl_cb_awake(),
it'll cause to call wl_display_read_events()/wl_display_cancel_events().
Calling those APIs will cause a deadlock in multi-threaded wayland clients.
Thus, we must return directly.
Change-Id: I6165989104038ff3b8435d18891dea3f7f979ac6
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
if (ret < 0)
{
ERR("Wayland Display Dispatch Pending Failed");
- break;
+ return;
}
}
ewd->prepare_read = EINA_FALSE;
+ if (ecore_main_fd_handler_active_get(ewd->fd_hdl, ECORE_FD_ERROR))
+ {
+ ERR("[ecore_wl_cb_awake] Received error on wayland display fd");
+ wl_display_cancel_read(ewd->wl.display);
+ return;
+ }
+
if (ecore_main_fd_handler_active_get(ewd->fd_hdl, ECORE_FD_READ))
wl_display_read_events(ewd->wl.display);
else