[cairo] scaled_font mutex locking cleanup

Behdad Esfahbod behdad at behdad.org
Sun Jun 22 12:23:44 PDT 2008


Currently we acquire/release the scaled-font mutex in
_cairo_surface_show_glyphs() and_cairo_mutex_glyph_path().  Also means
that wrapping surfaces like paginated have to unlock/lock the mutex
around the recursive _cairo_surface_show_glyphs() call.

Ideally all the locking should be done by cairo-scaled-font.c itself.  I
noticed that you need the locking exactly when you need the scaled-font
glyph cache release.  So how about moving the lock/unlock pair into
cache_freeze/unfreeze()?  While grepping I also noticed that only xlib,
xcb, and glitz backends freeze the cache in their show glyphs.  Which
means all the others are subject to race conditions of glyphs being
evicted from under their feet.


"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