[cairo] [PATCH] image: Avoid reusing pixman images for threadsafety.

Chris Wilson chris at chris-wilson.co.uk
Sat Feb 12 03:12:18 PST 2011


On Sat, 12 Feb 2011 02:16:06 +0200 (EET), M Joonas Pihlaja <jpihlaja at cc.helsinki.fi> wrote:
> 
> I'd like to push this commit to master and 1.10:
> 
> http://cgit.freedesktop.org/~joonas/cairo/commit/?h=no-pixman-ref&id=af403a204a88d882317a3e91abe8f0cc454852a4
> 
> It fixes the pthread-* tests by avoiding sharing of pixman_image_t
> objects and thus not relying on atomic ref/unref semantics in pixman.
> Applying this gives us the same threadsafety guarantees that 1.8 has
> in practise for the image backend.  We can easily revert it later when
> pixman does get atomics.

As much as this pains me to see, I do think this is the way forward.
However, I fear we may simply forget about this and wonder why we create
so many pixman_image_t in future. Can you wrap the affected parts in an
#if PIXMAN_HAS_ATOMIC_REFCNT and see how vile that looks? Judging from
that patch, I don't think it will be that unpleasant.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list