[Xfce4-commits] <xfdesktop:master> g_thread_try_new is too new

Eric Koegel noreply at xfce.org
Thu Sep 5 18:28:01 CEST 2013


Updating branch refs/heads/master
         to 6f246d057b2a83413c9506b8256704e95a0d02ce (commit)
       from 4d68c9816f35086a1ac41e627673a39123a3b244 (commit)

commit 6f246d057b2a83413c9506b8256704e95a0d02ce
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Thu Sep 5 19:24:28 2013 +0300

    g_thread_try_new is too new
    
    g_thread_try_new requires glib 2.32 so add support for the old
    thread_create function.

 settings/main.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/settings/main.c b/settings/main.c
index 9731b87..7a28041 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -258,9 +258,14 @@ xfdesktop_settings_add_file_to_queue(AppearancePanel *panel, PreviewData *pdata)
 
     /* Create the thread if it doesn't exist */
     if(panel->preview_thread == NULL) {
+#if GLIB_CHECK_VERSION(2, 32, 0)
         panel->preview_thread = g_thread_try_new("xfdesktop_settings_create_previews",
                                                  xfdesktop_settings_create_previews,
                                                  panel, NULL);
+#else
+        panel->preview_thread = g_thread_create(xfdesktop_settings_create_previews,
+                                                panel, FALSE, NULL);
+#endif
         if(panel->preview_thread == NULL)
         {
                 g_critical("Unable to create thread for image previews.");
@@ -1566,6 +1571,9 @@ main(int argc, char **argv)
 
     xfce_textdomain(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
 
+#if !GLIB_CHECK_VERSION(2, 32, 0)
+    g_thread_init(NULL);
+#endif
     gdk_threads_init();
 
     if(!gtk_init_with_args(&argc, &argv, "", option_entries, PACKAGE, &error)) {


More information about the Xfce4-commits mailing list