Skip to content
Commit 6d29c0da authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Pekka Paalanen
Browse files

client: Introduce proxy wrappers

Using the libwayland-client client API with multiple threads with
thread local queues are prone to race conditions.

The problem is that one thread can read and queue events after another
thread creates a proxy but before it sets the queue.

This may result in the event to the proxy being silently dropped, or
potentially dispatched on the wrong thread had the creating thread set
the implementation before setting the queue.

This patch introduces API to solve this case by introducing "proxy
wrappers". In short, a proxy wrapper is a wl_proxy struct that will
never itself proxy any events, but may be used by the client to set a
queue, and use it instead of the original proxy when sending requests
that creates new proxies. When sending requests, the wrapper will
work in the same way as the normal proxy object, but the proxy created
by sending a request (for example wl_display.sync) will inherit to the
same proxy queue as the wrapper.

https://bugs.freedesktop.org/show_bug.cgi?id=91273



Signed-off-by: default avatarJonas Ådahl <jadahl@gmail.com>
Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: default avatarDerek Foreman <derekf@osg.samsung.com>
parent 9a652c44
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment