summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-08-27 23:31:02 -0400
committerBehdad Esfahbod <behdad@behdad.org>2012-08-27 23:31:02 -0400
commitf160843b9afab5d8f39654580d7583cf49b0c242 (patch)
treec3689b4082e3b36f66db86a937b6e9a51319c638 /pango/pangofc-fontmap.c
parenta4eeee8e222db740ca83d29217d707db1160ada8 (diff)
downloadpango-f160843b9afab5d8f39654580d7583cf49b0c242.tar.gz
More thread-safety
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 4f053c97..8315b6b3 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -235,10 +235,10 @@ static FcPattern *uniquify_pattern (PangoFcFontMap *fcfontmap,
static gpointer
get_gravity_class (void)
{
- static GEnumClass *class = NULL;
+ static GEnumClass *class = NULL; /* MT-safe */
- if (G_UNLIKELY (!class))
- class = g_type_class_ref (PANGO_TYPE_GRAVITY);
+ if (g_once_init_enter ((gsize*)&class))
+ g_once_init_leave ((gsize*)&class, (gsize)g_type_class_ref (PANGO_TYPE_GRAVITY));
return class;
}