GNOME Bugzilla – Bug 658683
clean up charset/language threading issues
Last modified: 2011-09-10 00:34:50 UTC
The functions g_get_{charset,filename_charsets,language_names} all return constant strings that they cache on a per-thread basis (to facilitate changing the locale). These functions are currently called from g_thread_init() to get themselves initialised in a guaranteed single-threaded environment. This is probably a good idea since they interact with the somewhat thread-unsafe libcharset code that we have in-tree. We need to clean this up a bit...
Created attachment 196154 [details] [review] Clean up l10n threading stuff Remove the explicit thread initialisation functions for g_get_charset(), g_get_filename_charsets() and g_get_language_names(). Add a lock around one remaining case of access to libcharset (the other 2 cases already have the lock). Do a proper g_once_init_enter() style initialisation for the GLib gettext functions.
Review of attachment 196154 [details] [review]: Looks obvious enough. Did you want to replace that unalias call in gutf8.c as well, or has that already happened ?
didn't do anything yet. was trying to keep the patch minimal. shall i submit a separate patch?
separate patch sounds great
the hashtable maps canonical names to list of aliases for that name the function below is trying to turn an alias into a canonical name. so we can't use the hashtable for that. therefore: no new patch.