[cairo] Fixing concurrency bugs in cairo's reference counting

Solerman Kaplon solerman at wonder.com.br
Mon Dec 18 13:14:15 PST 2006


Jamey Sharp escreveu:
> The Linux kernel function atomic_dec_and_test, in <asm/atomic.h>,
> atomically decrements, but leaves the new value in a register, so it
> needn't re-fetch. (Actually, on x86, it only leaves the zero-flag set.)
> glibc has an equivalent, though I think it isn't installed for
> applications to use...
>   
On windows I saw apps using InterlockedDecrement, takes a variable and 
return the value after the decrement so you could test it and then free. 
A bit of research shows wine has implemented it:

http://source.winehq.org/source/dlls/kernel32/sync.c

Solerman


More information about the cairo mailing list