src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc
changeset 50826 f5b95be8b6e2
parent 48274 51772bf1fb0c
child 54232 7c11a7cc7c1d
equal deleted inserted replaced
50825:aa0a35b071fb 50826:f5b95be8b6e2
    42 
    42 
    43 #ifdef HB_USE_ATEXIT
    43 #ifdef HB_USE_ATEXIT
    44 static
    44 static
    45 void free_static_shapers (void)
    45 void free_static_shapers (void)
    46 {
    46 {
    47   if (unlikely (static_shapers != all_shapers))
    47 retry:
    48     free ((void *) static_shapers);
    48   hb_shaper_pair_t *shapers = (hb_shaper_pair_t *) hb_atomic_ptr_get (&static_shapers);
       
    49   if (!hb_atomic_ptr_cmpexch (&static_shapers, shapers, nullptr))
       
    50     goto retry;
       
    51 
       
    52   if (unlikely (shapers != all_shapers))
       
    53     free ((void *) shapers);
    49 }
    54 }
    50 #endif
    55 #endif
    51 
    56 
    52 const hb_shaper_pair_t *
    57 const hb_shaper_pair_t *
    53 _hb_shapers_get (void)
    58 _hb_shapers_get (void)