return is_utf8;
}
-/* This is called from g_thread_init(). It's used to
- * initialize some static data in a threadsafe way.
- */
-void
-_g_convert_thread_init (void)
-{
- const gchar **dummy;
- (void) g_get_filename_charsets (&dummy);
-}
-
/**
* g_filename_to_utf8:
* @opsysstring: a string in the encoding for filenames
/* accomplish log system initialization to enable messaging */
_g_messages_thread_init_nomessage ();
-
- /* we may run full-fledged initializers from here */
- _g_convert_thread_init ();
- _g_utils_thread_init ();
}
/* The following sections implement: GOnce, GStaticMutex, GStaticRecMutex,
G_GNUC_INTERNAL void _g_messages_thread_init_nomessage (void);
/* full fledged initializers */
-G_GNUC_INTERNAL void _g_convert_thread_init (void);
-G_GNUC_INTERNAL void _g_utils_thread_init (void);
G_GNUC_INTERNAL void _g_thread_impl_init (void);
G_END_DECLS
g_static_private_set (&cache_private, cache, charset_cache_free);
}
+ G_LOCK (aliases);
raw = _g_locale_charset_raw ();
+ G_UNLOCK (aliases);
if (!(cache->raw && strcmp (cache->raw, raw) == 0))
{
return g_strdup (charset);
}
-/* This is called from g_thread_init(). It's used to
- * initialize some static data in a threadsafe way.
- */
-void
-_g_utils_thread_init (void)
-{
- g_get_language_names ();
-}
-
#ifdef G_OS_WIN32
/**
#endif /* G_OS_WIN32 */
static void
-ensure_gettext_initialized(void)
+ensure_gettext_initialized (void)
{
- static gboolean _glib_gettext_initialized = FALSE;
+ static gsize initialised;
- if (!_glib_gettext_initialized)
+ g_thread_init_glib ();
+
+ if (g_once_init_enter (&initialised))
{
#ifdef G_OS_WIN32
gchar *tmp = _glib_get_locale_dir ();
# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
# endif
- _glib_gettext_initialized = TRUE;
+ g_once_init_leave (&initialised, TRUE);
}
}