scaled-font: assert that we hold the scaled-font mutex when looking up glyphs

Holding the mutex over glyph lookup not only prevents multi-threaded
races between insertion and deletion that spell disaster for memory
integrity, but also implies that the glyph cache is frozen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2010-12-13 16:25:58 +00:00
parent 5eadc286d8
commit f10b3105d3

View file

@ -2793,6 +2793,8 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
if (unlikely (scaled_font->status))
return scaled_font->status;
assert (CAIRO_MUTEX_IS_LOCKED(scaled_font->mutex));
if (CAIRO_INJECT_FAULT ())
return _cairo_error (CAIRO_STATUS_NO_MEMORY);