! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
g_thread_create() is deprecated with GLib >= 2.32
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Olivier Duchateau 2012-11-12 19:15:25 CET
In the next stable version (9.1) of FreeBSD, GLib will be updated (2.28.x to 2.34.x).

In this new release (since 2.32, I seen in documentation)  g_thread_create() is deprecated. They recommend to use g_thread_new() instead. So I made patch (see below) for settings/main.c file, there isn't warning during compilation stage, but I wonder if the first parameter is correct.


@@ -730,7 +743,11 @@
 
     /* generate previews of each image -- the new thread will own
      * the reference on the list store, so let's not unref it here */
+#if GLIB_CHECK_VERSION (2, 32, 0)
+    if(!g_thread_new("BackdropPreviewsThread", xfdesktop_settings_create_all_previews, ls)) {
+#else
     if(!g_thread_create(xfdesktop_settings_create_all_previews, ls, FALSE, NULL)) {
+#endif
         g_critical("Failed to spawn thread; backdrop previews will be unavailable.");
         g_object_unref(G_OBJECT(ls));
     }
@@ -924,9 +941,15 @@
         }
         g_slist_free(filenames);
 
+#if GLIB_CHECK_VERSION (2, 32, 0)
+        if(!pdata->iters
+           || !g_thread_new("ImagePreviewThread", xfdesktop_settings_create_some_previews,
+                               pdata))
+#else
         if(!pdata->iters
            || !g_thread_create(xfdesktop_settings_create_some_previews,
                                pdata, FALSE, NULL))
+#endif
         {
             if(pdata->iters)
                 g_critical("Unable to create thread for single image preview.");
@@ -1237,9 +1260,15 @@
 
     file_added = !!pdata->iters;
 
+#if GLIB_CHECK_VERSION (2, 32, 0)
+    if(!pdata->iters
+       || !g_thread_new("ImagePreviewThread", xfdesktop_settings_create_some_previews,
+                           pdata))
+#else
     if(!pdata->iters
        || !g_thread_create(xfdesktop_settings_create_some_previews,
                            pdata, FALSE, NULL))
+#endif
     {
         if(pdata->iters)
             g_critical("Unable to create thread for single image preview.");

Bug #9492

Reported by:
Olivier Duchateau
Reported on: 2012-11-12
Last modified on: 2013-01-26

People

Assignee:
Eric Koegel
CC List:
3 users

Version

Version:
4.10.0

Attachments

Additional information