shm: Defer wl_shm_pool_resize if a pool has external references
authorDerek Foreman <derekf@osg.samsung.com>
Tue, 9 Feb 2016 22:03:48 +0000 (16:03 -0600)
committerBryce Harrington <bryce@osg.samsung.com>
Wed, 9 Mar 2016 00:54:38 +0000 (16:54 -0800)
commited5f5030cae66576b081f261afb6233ec634f287
treecf81a637e7f4b2f30b07df80cac404bd89bca914
parent442f4435868c1ea37e99d3f4fb316434e96faab1
shm: Defer wl_shm_pool_resize if a pool has external references

If a compositor is rendering in one thread while dispatching wayland
events in another, a wl_shm_pool_resize() could change the memory
mappings it's rendering from and cause a crash.

Now we defer wl_shm_pool_resize() if the compositor has references on a
pool, and perform the actual resize when it drops those references.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
src/wayland-shm.c