[tracker/compilation-warnings: 13/13] tracker-writeback: use g_thread_try_new() if GLib >= 2.31
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/compilation-warnings: 13/13] tracker-writeback: use g_thread_try_new() if GLib >= 2.31
- Date: Fri, 16 Dec 2011 12:44:52 +0000 (UTC)
commit 206d92649ddaae2f3993ba207b3cab54a3b38802
Author: Aleksander Morgado <aleksander lanedo com>
Date: Fri Dec 16 13:03:28 2011 +0100
tracker-writeback: use g_thread_try_new() if GLib >= 2.31
Since 2.31, g_thread_create() is deprecated.
src/tracker-writeback/tracker-writeback.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback.c b/src/tracker-writeback/tracker-writeback.c
index afc4f17..77fc86a 100644
--- a/src/tracker-writeback/tracker-writeback.c
+++ b/src/tracker-writeback/tracker-writeback.c
@@ -925,10 +925,26 @@ tracker_controller_start (TrackerController *controller,
modules = modules->next;
}
+#if GLIB_CHECK_VERSION (2,31,0)
+ {
+ GThread *thread;
+
+ thread = g_thread_try_new ("controller",
+ tracker_controller_thread_func,
+ controller,
+ error);
+ if (!thread)
+ return FALSE;
+
+ /* We don't want to join it, so just unref the GThread */
+ g_thread_unref (thread);
+ }
+#else
if (!g_thread_create (tracker_controller_thread_func,
controller, FALSE, error)) {
return FALSE;
}
+#endif
#ifdef THREAD_ENABLE_TRACE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]