[pango] Make static data thread safe in pangocairo-fontmap.c
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Make static data thread safe in pangocairo-fontmap.c
- Date: Tue, 28 Aug 2012 04:33:47 +0000 (UTC)
commit 86d88852671426517c532e9d2ad7f998061b8ea3
Author: Alessandro Pignotti <a pignotti sssup it>
Date: Fri May 20 23:03:57 2011 +0200
Make static data thread safe in pangocairo-fontmap.c
pango/pangocairo-fontmap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c
index 0bea979..cfc658f 100644
--- a/pango/pangocairo-fontmap.c
+++ b/pango/pangocairo-fontmap.c
@@ -149,8 +149,8 @@ static PangoFontMap *default_font_map = NULL;
PangoFontMap *
pango_cairo_font_map_get_default (void)
{
- if (G_UNLIKELY (!default_font_map))
- default_font_map = pango_cairo_font_map_new ();
+ if (g_once_init_enter ((gsize*)&default_font_map))
+ g_once_init_leave((gsize*)&default_font_map, (gsize)pango_cairo_font_map_new ());
return default_font_map;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]