Skip to content
Commit eba83cd5 authored by Derek Foreman's avatar Derek Foreman
Browse files

shm: Add shm_buffer ref and shm_pool unref functions



Sometimes the compositor wants to make sure a shm pool doesn't disappear
out from under it.

For example, in Enlightenment, rendering happens in a separate thread
while the main thread can still dispatch events.  If a client is destroyed
during rendering, all its resources are cleaned up and its shm pools are
unmapped.  This causes the rendering thread to segfault.

This patch adds a way for the compositor to increment the refcount of the
shm pool so it can't disappear, and decrement it when it's finished.

The ref/unref are asymmetrical (ref returns the pool) because it's
possible the buffer itself will be gone when you need to unref the pool.

Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: default avatarDerek Foreman <derekf@osg.samsung.com>
parent 06fb8bd3
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