[ot-font] Use atomic ops for cache serial number
This guarantees the cache is coherent.
This commit is contained in:
parent
5248b2567b
commit
a719e67887
|
@ -181,7 +181,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
|
|||
hb_free (cache);
|
||||
goto retry;
|
||||
}
|
||||
ot_font->cached_coords_serial.set_relaxed (font->serial_coords);
|
||||
ot_font->cached_coords_serial.set (font->serial_coords);
|
||||
}
|
||||
}
|
||||
out:
|
||||
|
@ -197,10 +197,10 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
|
|||
}
|
||||
else
|
||||
{ /* Use cache. */
|
||||
if (ot_font->cached_coords_serial.get_relaxed () != (int) font->serial_coords)
|
||||
if (ot_font->cached_coords_serial.get () != (int) font->serial_coords)
|
||||
{
|
||||
ot_font->advance_cache->init ();
|
||||
ot_font->cached_coords_serial.set_relaxed (font->serial_coords);
|
||||
ot_font->cached_coords_serial.set (font->serial_coords);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
|
|
Loading…
Reference in New Issue