about summary refs log tree commit diff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index b7c0fd5a..12a0b893 100644
--- a/src/main.c
+++ b/src/main.c
@@ -563,9 +563,18 @@ main (int argc, char *argv[])
 	umask (022);
 
 	g_type_init ();
+
+/*
+ * Threading is always enabled starting from GLib 2.31.0.
+ * See also http://developer.gnome.org/glib/2.31/glib-Deprecated-Thread-APIs.html.
+ */
+#if !GLIB_CHECK_VERSION (2,31,0)
 	if (!g_thread_supported ())
 		g_thread_init (NULL);
 	dbus_g_thread_init ();
+#else
+	dbus_threads_init_default ();
+#endif
 
 #ifndef HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS
 #error HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS not defined