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 <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
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;