Re: [PATCH] client: Add wl_display_prepare_read() API to thread model assumptions

2013-05-17 Thread Kristian Høgsberg
On Wed, May 01, 2013 at 06:24:23PM +0200, Uli Schlachter wrote: > On 01.05.2013 17:52, Kristian Høgsberg wrote: > > On Tue, Apr 30, 2013 at 11:45:15PM +0200, Uli Schlachter wrote: > >> On 30.04.2013 22:06, Kristian Høgsberg wrote: > >> [...] > >>> diff --git a/src/connection.c b/src/connection.c >

Re: [PATCH] client: Add wl_display_prepare_read() API to thread model assumptions

2013-05-01 Thread Bill Spitzak
Kristian Høgsberg wrote: + * A correct sequence would be: + * + * while (wl_display_prepare_read(display) != 0) + * wl_display_dispatch_pending(display); + * wl_display_flush(display); + * poll(fds, nfds, -1); + * wl_display_read_events(display); + * wl_display_dispatch_pendi

Re: [PATCH] client: Add wl_display_prepare_read() API to thread model assumptions

2013-05-01 Thread Uli Schlachter
On 01.05.2013 17:52, Kristian Høgsberg wrote: > On Tue, Apr 30, 2013 at 11:45:15PM +0200, Uli Schlachter wrote: >> On 30.04.2013 22:06, Kristian Høgsberg wrote: >> [...] >>> diff --git a/src/connection.c b/src/connection.c >>> index dca134b..b26402f 100644 >>> --- a/src/connection.c >>> +++ b/src/c

Re: [PATCH] client: Add wl_display_prepare_read() API to thread model assumptions

2013-05-01 Thread Kristian Høgsberg
On Tue, Apr 30, 2013 at 11:45:15PM +0200, Uli Schlachter wrote: > Evening, > > On 30.04.2013 22:06, Kristian Høgsberg wrote: > [...] > > diff --git a/src/connection.c b/src/connection.c > > index dca134b..b26402f 100644 > > --- a/src/connection.c > > +++ b/src/connection.c > > @@ -324,7 +324,7 @@

Re: [PATCH] client: Add wl_display_prepare_read() API to thread model assumptions

2013-04-30 Thread Uli Schlachter
Evening, On 30.04.2013 22:06, Kristian Høgsberg wrote: [...] > diff --git a/src/connection.c b/src/connection.c > index dca134b..b26402f 100644 > --- a/src/connection.c > +++ b/src/connection.c > @@ -324,7 +324,7 @@ wl_connection_read(struct wl_connection *connection) > msg.msg_flags = 0; >

[PATCH] client: Add wl_display_prepare_read() API to thread model assumptions

2013-04-30 Thread Kristian Høgsberg
The current thread model assumes that the application or toolkit will have one thread that either polls the display fd and dispatches events or just dispatches in a loop. Only this main thread will read from the fd while all other threads will block on a pthread condition and expect the main threa