[pango] Make static data thread safe in pango-engine.c



commit 816c5ab46c51850645ac94e4bf611b7fbda3fa19
Author: Alessandro Pignotti <a pignotti sssup it>
Date:   Wed May 25 15:47:19 2011 +0200

    Make static data thread safe in pango-engine.c

 pango/pango-engine.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pango/pango-engine.c b/pango/pango-engine.c
index 8e87402..eb75dd0 100644
--- a/pango/pango-engine.c
+++ b/pango/pango-engine.c
@@ -198,8 +198,8 @@ PangoEngineShape *
 _pango_get_fallback_shaper (void)
 {
   static PangoEngineShape *fallback_shaper = NULL;
-  if (!fallback_shaper)
-    fallback_shaper = g_object_new (pango_fallback_engine_get_type (), NULL);
+  if (g_once_init_enter ((gsize*)&fallback_shaper))
+    g_once_init_leave((gsize*)&fallback_shaper, (gsize)g_object_new (pango_fallback_engine_get_type (), NULL));
 
   return fallback_shaper;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]