<div dir="ltr"><div>I took a look at it too and it looks good to me<br></div>--Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 1:46 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, 10 Sep 2014 12:47:14 +0200<br>
Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>> wrote:<br>
<br>
> Calling wl_display_read_events() after an error should be equivalent<br>
> to wl_display_cancel_read(), so that display state is consistent.<br>
><br>
> Thanks to Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
> for pointing that out.<br>
><br>
> Signed-off-by: Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>><br>
> ---<br>
>  src/wayland-client.c | 13 ++++++++++---<br>
>  1 file changed, 10 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/src/wayland-client.c b/src/wayland-client.c<br>
> index 1b7a046..b0f77b9 100644<br>
> --- a/src/wayland-client.c<br>
> +++ b/src/wayland-client.c<br>
> @@ -1192,6 +1192,14 @@ read_events(struct wl_display *display)<br>
>       return 0;<br>
>  }<br>
><br>
> +static void<br>
> +cancel_read(struct wl_display *display)<br>
> +{<br>
> +     display->reader_count--;<br>
> +     if (display->reader_count == 0)<br>
> +             display_wakeup_threads(display);<br>
> +}<br>
> +<br>
>  /** Read events from display file descriptor<br>
>   *<br>
>   * \param display The display context object<br>
> @@ -1219,6 +1227,7 @@ wl_display_read_events(struct wl_display *display)<br>
>       pthread_mutex_lock(&display->mutex);<br>
><br>
>       if (display->last_error) {<br>
> +             cancel_read(display);<br>
>               pthread_mutex_unlock(&display->mutex);<br>
><br>
>               errno = display->last_error;<br>
> @@ -1365,9 +1374,7 @@ wl_display_cancel_read(struct wl_display *display)<br>
>  {<br>
>       pthread_mutex_lock(&display->mutex);<br>
><br>
> -     display->reader_count--;<br>
> -     if (display->reader_count == 0)<br>
> -             display_wakeup_threads(display);<br>
> +     cancel_read(display);<br>
><br>
>       pthread_mutex_unlock(&display->mutex);<br>
>  }<br>
<br>
</div></div>All three pushed.<br>
<br>
<br>
Thanks,<br>
pq<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br></div>