From: Behdad Esfahbod Date: Thu, 5 May 2011 19:14:04 +0000 (-0400) Subject: Use threadsafe set implementation for hb_language lookups X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8d6183ebc4697a434776cf2aec7857d63a7d881;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Use threadsafe set implementation for hb_language lookups Note that the static variable has to be a global static, as gcc implements local statics differently and that would require linking to libstdc++, which we don't want. --- diff --git a/src/hb-common.cc b/src/hb-common.cc index 67988c3..368789a 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -28,6 +28,8 @@ #include "hb-private.hh" +#include "hb-mutex-private.hh" + HB_BEGIN_DECLS @@ -155,11 +157,11 @@ struct hb_language_item_t { void finish (void) { free (lang); } }; +static hb_threadsafe_set_t langs; + hb_language_t hb_language_from_string (const char *str) { - static hb_set_t langs; - if (!str || !*str) return NULL;