[tracker/compilation-warnings: 8/13] libtracker-data: use GMutex if GLib >= 2.31
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/compilation-warnings: 8/13] libtracker-data: use GMutex if GLib >= 2.31
- Date: Fri, 16 Dec 2011 12:44:26 +0000 (UTC)
commit 86f72033f9f53720ee085bf3982ab2f9a6ef10f6
Author: Aleksander Morgado <aleksander lanedo com>
Date: Fri Dec 16 12:20:55 2011 +0100
libtracker-data: use GMutex if GLib >= 2.31
Since 2.31, GStaticMutex is deprecated.
src/libtracker-data/tracker-db-manager.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index b8157b5..a407d3f 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -169,7 +169,12 @@ static GStaticPrivate interface_data_key = G_STATIC_PRIVATE_INIT;
#endif
/* mutex used by singleton connection in libtracker-direct, not used by tracker-store */
+#if GLIB_CHECK_VERSION (2,31,0)
+static GMutex global_mutex;
+#else
static GStaticMutex global_mutex = G_STATIC_MUTEX_INIT;
+#endif
+
static TrackerDBInterface *global_iface;
static const gchar *
@@ -1820,17 +1825,29 @@ tracker_db_manager_set_need_mtime_check (gboolean needed)
void
tracker_db_manager_lock (void)
{
+#if GLIB_CHECK_VERSION (2,31,0)
+ g_mutex_lock (&global_mutex);
+#else
g_static_mutex_lock (&global_mutex);
+#endif
}
gboolean
tracker_db_manager_trylock (void)
{
+#if GLIB_CHECK_VERSION (2,31,0)
+ return g_mutex_trylock (&global_mutex);
+#else
return g_static_mutex_trylock (&global_mutex);
+#endif
}
void
tracker_db_manager_unlock (void)
{
+#if GLIB_CHECK_VERSION (2,31,0)
+ g_mutex_unlock (&global_mutex);
+#else
g_static_mutex_unlock (&global_mutex);
+#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]