mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 14:38:13 +02:00
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:
parent
5eadc286d8
commit
f10b3105d3
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue