[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xcb
Subject:    Re: [Xcb] [PATCH 1/2] Call _xcb_wake_up_next_reader from xcb_wait_for_special_event
From:       Uli Schlachter <psychon () znc ! in>
Date:       2015-05-30 12:16:47
Message-ID: 5569AA2F.1040600 () znc ! in
[Download RAW message or body]

Am 25.05.2015 um 10:50 schrieb Michel Dänzer:
> From: Michel Dänzer <michel.daenzer@amd.com>

I would suggest adding something like this to the commit message:

  All functions calling _xcb_conn_wait() must make sure that waiting readers
  are woken up when we read a reply or event that they are waiting for.
  xcb_wait_for_special_event() did not do so. This adds the missing call to
  _xcb_in_wake_up_next_reader()

> Fixes deadlock when waiting for a special event and concurrently
> processing the display connection queue in another thread.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84252
> Tested-by: Thomas Daede <bztdlinux@gmail.com>
> Tested-by: Clément Guérin <geecko.dev@free.fr>
> Signed-off-by: Michel Dänzer <michel@daenzer.net>

Reviewed-by: Uli Schlachter <psychon@znc.in>

(With or without the above extension to the commit message)

> ---
>  src/xcb_in.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/xcb_in.c b/src/xcb_in.c
> index 623a0a8..322bed8 100644
> --- a/src/xcb_in.c
> +++ b/src/xcb_in.c
> @@ -761,6 +761,7 @@ xcb_generic_event_t *xcb_wait_for_special_event(xcb_connection_t *c,
>          if(!_xcb_conn_wait(c, &se->special_event_cond, 0, 0))
>              break;
>  
> +    _xcb_in_wake_up_next_reader(c);
>      pthread_mutex_unlock(&c->iolock);
>      return event;
>  }
> 


-- 
- Captain, I think I should tell you I've never
  actually landed a starship before.
- That's all right, Lieutenant, neither have I.
_______________________________________________
Xcb mailing list
Xcb@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xcb
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic