• Chris Wilson's avatar
    snapshot: Perform the cow under a mutex · 7eb33099
    Chris Wilson authored
    In order to prevent a race between concurrent destroy and use in another
    thread, we need to acquire a reference to the snapshot->target under a
    mutex. Whilst we hold that reference, it prevents the internal destroy
    mechanism from freeing the memory we are using (if we have a pointer to
    the original surface) and the client drops their final reference.
    Oh boy, talk about opening a can of worms...
    Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
cairo-surface-snapshot.c 8.33 KB