summaryrefslogtreecommitdiff
path: root/src/libtracker-common/tracker-locale.c
diff options
context:
space:
mode:
authorPhilip Van Hoof <philip@codeminded.be>2011-03-22 12:52:03 +0100
committerPhilip Van Hoof <philip@codeminded.be>2011-03-22 12:53:25 +0100
commita3d1504d8c3ff35654127bfd037caa1167d9ebec (patch)
tree5220fe813fe53c28be438441b989d519974f48cb /src/libtracker-common/tracker-locale.c
parent89a502e3e859bbc1e70ddd03bc8b6e7552809b51 (diff)
downloadtracker-a3d1504d8c3ff35654127bfd037caa1167d9ebec.tar.gz
libtracker-sparql, -common: GConfClient's get_default isn't thread-safe, workaround this issue
Fixes NB#238447.
Diffstat (limited to 'src/libtracker-common/tracker-locale.c')
-rw-r--r--src/libtracker-common/tracker-locale.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libtracker-common/tracker-locale.c b/src/libtracker-common/tracker-locale.c
index 73a6b91fb..3a00cb188 100644
--- a/src/libtracker-common/tracker-locale.c
+++ b/src/libtracker-common/tracker-locale.c
@@ -31,6 +31,18 @@
#endif /* HAVE_MAEMO */
#ifdef HAVE_MAEMO
+
+/* In src/libtracker-sparql/tracker-init.c you'll find a first call to
+ * gconf_client_get_default() in a function that has the GCC specific
+ * construction attribute. This is there because GConfClient isn't thread-safe
+ * or at least not "first call is in thread vs. mainloop"-safe. The reason
+ * why it must be in libtracker-sparql instead of here is because this code
+ * is entered using g_module_open (dlopen) by tracker_sparql_backend_load_
+ * plugins_from_path: the construction attribute would only be detected at
+ * dlopen, which would be in the thread that calls load_plugins_from_path
+ * caused by a tracker_sparql_connection_get_async. It's a bit unfortunate
+ * and perhaps ugly, but fortunately we only need it in HAVE_MAEMO */
+
/* Mutex to sync access to the current locale values */
static GStaticMutex locales_mutex = G_STATIC_MUTEX_INIT;
static GStaticMutex subscribers_mutex = G_STATIC_MUTEX_INIT;