[PATCH wayland v2 2/2] client: update documentation about threading

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 28 05:44:37 PST 2014


On Fri, 28 Nov 2014 12:18:56 +0100
Marek Chalupa <mchqwerty at gmail.com> wrote:

> Remove out-dated documentation and add few more words
> about this topic.
> 
> v2. replace a paragraph by better explanation from Pekka Paalanen
>     fix other notes from reviewing
> 
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  src/wayland-client.c | 106 +++++++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 91 insertions(+), 15 deletions(-)
> 
> diff --git a/src/wayland-client.c b/src/wayland-client.c
> index 0ab94e9..fee39f3 100644
> --- a/src/wayland-client.c
> +++ b/src/wayland-client.c
> @@ -909,6 +909,12 @@ static const struct wl_callback_listener sync_listener = {
>   * Blocks until the server process all currently issued requests and
>   * sends out pending events on the event queue.
>   *
> + * \note This function uses wl_display_dispatch_queue() internally. If you
> + * are using wl_display_read_events() from more threads, don't use this function
> + * (or make sure that calling wl_display_roundtrip_queue() doesn't interfere
> + * with calling wl_display_prepare_read() and wl_display_read_events())
> + *
> + * \sa wl_display_roundtrip()
>   * \memberof wl_display
>   */
>  WL_EXPORT int
> @@ -940,6 +946,11 @@ wl_display_roundtrip_queue(struct wl_display *display, struct wl_event_queue *qu
>   * Blocks until the server process all currently issued requests and
>   * sends out pending events on the default event queue.
>   *
> + * \note This function uses wl_display_dispatch_queue() internally. If you
> + * are using wl_display_read_events() from more threads, don't use this function
> + * (or make sure that calling wl_display_roundtrip() doesn't interfere
> + * with calling wl_display_prepare_read() and wl_display_read_events())
> + *
>   * \memberof wl_display
>   */
>  WL_EXPORT int
> @@ -1216,14 +1227,59 @@ cancel_read(struct wl_display *display)
>   *
>   * This will read events from the file descriptor for the display.
>   * This function does not dispatch events, it only reads and queues
> - * events into their corresponding event queues.  If no data is
> - * available on the file descriptor, wl_display_read_events() returns
> - * immediately.  To dispatch events that may have been queued, call
> - * wl_display_dispatch_pending() or
> - * wl_display_dispatch_queue_pending().
> + * events into their corresponding event queues. If no data is
> + * avilable on the file descriptor, wl_display_read_events() returns

"avilable"

That the only thing I can complain about in this patch. ;-)

This patch depends on patch 1, otherwise I would have just pushed this.


Thanks,
pq


More information about the wayland-devel mailing list