[cairo] New per-scaled_font mutex to fix locking bugs

Behdad Esfahbod behdad at behdad.org
Tue Feb 6 16:43:04 PST 2007


On Mon, 2007-02-05 at 21:54 -0500, Keith Packard wrote:
> 
> > > The only thing I'm unsure of there is the NIL_INITIALIZER. This is
> > > only used when initializing the mutex for a nil surface, so the
> value
> > > won't ever be looked at, but it does need to compile at least.
> > 
> > I assumme your intention is to be able to type:
> > 
> >       static cairo_mutex_t foo = CAIRO_MUTEX_NIL_INITIALIZER;
> 
> No, this initializer is used only for the nil scaled font object,
> which
> has no glyphs and will never attempt to lock this mutex. So, it just
> needs something that will compile, not generate correct data. 

So, worst case is that you have to keep a pointer there instead of the
mutex itself.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list