From: Marek Chalupa Date: Wed, 10 Sep 2014 10:47:13 +0000 (+0200) Subject: client: wake-up threads on all return paths from read_events X-Git-Tag: 1.5.93~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a31a7360093dd5f4ce1a34b9889560fc37dbb7a9;p=platform%2Fupstream%2Fwayland.git client: wake-up threads on all return paths from read_events If wl_connection_read returned EAGAIN, we must wake up sleeping threads. If we don't do this and the thread calling wl_connection_read won't call wl_display_read_events again, the sleeping threads will sleep indefinitely. Signed-off-by: Marek Chalupa Reviewed-by: Pekka Paalanen --- diff --git a/src/wayland-client.c b/src/wayland-client.c index 9f817f6..1b7a046 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1152,8 +1152,13 @@ read_events(struct wl_display *display) if (display->reader_count == 0) { total = wl_connection_read(display->connection); if (total == -1) { - if (errno == EAGAIN) + if (errno == EAGAIN) { + /* we must wake up threads whenever + * the reader_count dropped to 0 */ + display_wakeup_threads(display); + return 0; + } display_fatal_error(display, errno); return -1;