Make TSan happy with make_immutable()
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 26 Sep 2018 19:03:07 +0000 (15:03 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 26 Sep 2018 19:03:07 +0000 (15:03 -0400)
src/hb-blob.cc
src/hb-face.cc
src/hb-font.cc
src/hb-unicode.cc

index fca3c91..f095266 100644 (file)
@@ -293,6 +293,8 @@ hb_blob_make_immutable (hb_blob_t *blob)
 {
   if (hb_object_is_inert (blob))
     return;
+  if (blob->immutable)
+    return;
 
   blob->immutable = true;
 }
index 19eea4d..fbab18a 100644 (file)
@@ -325,6 +325,8 @@ hb_face_make_immutable (hb_face_t *face)
 {
   if (unlikely (hb_object_is_inert (face)))
     return;
+  if (face->immutable)
+    return;
 
   face->immutable = true;
 }
index 9dcf6c1..77762f2 100644 (file)
@@ -586,6 +586,8 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
 {
   if (unlikely (hb_object_is_inert (ffuncs)))
     return;
+  if (ffuncs->immutable)
+    return;
 
   ffuncs->immutable = true;
 }
@@ -1444,6 +1446,8 @@ hb_font_make_immutable (hb_font_t *font)
 {
   if (unlikely (hb_object_is_inert (font)))
     return;
+  if (font->immutable)
+    return;
 
   if (font->parent)
     hb_font_make_immutable (font->parent);
index bb1cd68..0e8b520 100644 (file)
@@ -308,6 +308,8 @@ hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
 {
   if (unlikely (hb_object_is_inert (ufuncs)))
     return;
+  if (ufuncs->immutable)
+    return;
 
   ufuncs->immutable = true;
 }