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 <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Marek Chalupa 2014-09-10 12:47:13 +02:00 committed by Pekka Paalanen
parent 65d02b7a83
commit a31a736009

View File

@ -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;