Adding wl_proxy_marshal_array_flags_queue to assign a queue atomically
I would like to add a new function to the client-side api:
struct wl_proxy *
wl_proxy_marshal_array_flags_queue(
struct wl_proxy *proxy,
uint32_t opcode,
const struct wl_interface *interface,
uint32_t version,
uint32_t flags,
struct wl_event_queue *queue,
union wl_argument *args
);
This function would behave just like wl_proxy_marshal_array_flags
except that:
- if
queue
is not null, then this queue is atomically assigned to the returned proxy, if any - if
version
is 0, then the version from theproxy
is used
The first point is relatively clear. It allows safe language bindings to create new objects safely even if they don't know the queue of the proxy
and without having to create on-off wrapper objects. This is otherwise unsafe since the queue of proxy
might get dispatched between the proxy being created and the wrapper manually assigning the correct queue.
The second point addresses a design mistake of wl_proxy_marshal_array_flags
. Almost all code just calls wl_proxy_get_version
for this argument. Since 0 is never used as a version, 0 can be used as a sentinel value to avoid this unnecessary function call.
What do you think?