[atomic] Add hb_atomic_ptr_t<> and port all uses Found and fixed a couple bugs. Found a couple multithreading issues. Marked them with "XXX-MT-bug".
diff --git a/src/hb-face.cc b/src/hb-face.cc index e149275..49f29d3 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc
@@ -78,12 +78,12 @@ 0, /* num_glyphs */ { -#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID, +#define HB_SHAPER_IMPLEMENT(shaper) HB_ATOMIC_PTR_INIT (HB_SHAPER_DATA_INVALID), #include "hb-shaper-list.hh" #undef HB_SHAPER_IMPLEMENT }, - nullptr, /* shape_plans */ + HB_ATOMIC_PTR_INIT (nullptr), /* shape_plans */ }; @@ -249,7 +249,7 @@ { if (!hb_object_destroy (face)) return; - for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) + for (hb_face_t::plan_node_t *node = face->shape_plans.get (); node; ) { hb_face_t::plan_node_t *next = node->next; hb_shape_plan_destroy (node->shape_plan);