client: Add new proxy marshalling functions with flags
authorDerek Foreman <derek.foreman@collabora.com>
Wed, 21 Jul 2021 21:26:00 +0000 (16:26 -0500)
committerDaniel Stone <daniels@collabora.com>
Sat, 7 Aug 2021 11:53:23 +0000 (11:53 +0000)
commit23e4a7060080ebb61f516a2edcd71ab123029c0e
tree89de14e9caf826a41d5c141b5b8c9920d8ef44cc
parent942f1d88431d394ac661af7b192154ba7aa68c29
client: Add new proxy marshalling functions with flags

There's a race when destroying wayland objects in a multi-threaded client.
This occurs because we call:
wl_proxy_marshal(foo);
wl_proxy_destroy(foo);

And each of these functions takes, and releases, the display mutex.
Between the two calls, the display is not locked.

In order to allow atomically marshalling the proxy and destroying the
proxy without releasing the lock, add yet more wl_proxy_marshal_*
functions.  This time add flags and jam in all existing warts with the
hope that we can make it future proof this time.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
src/wayland-client-core.h
src/wayland-client.c