[gnome-desktop] Update to new GMutex API
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] Update to new GMutex API
- Date: Mon, 16 Jul 2012 16:10:07 +0000 (UTC)
commit 059a8ad39f9af50db8d55fa5429c4cc2756ffb01
Author: Colin Walters <walters verbum org>
Date: Mon Jul 16 11:44:22 2012 -0400
Update to new GMutex API
configure.ac | 2 +-
libgnome-desktop/gnome-desktop-thumbnail.c | 34 ++++++++++++---------------
2 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d2355f4..6661789 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,7 @@ dnl it too, or it will never make it into the spec file!
GDK_PIXBUF_REQUIRED=2.21.3
GTK_REQUIRED=3.3.6
-GLIB_REQUIRED=2.19.1
+GLIB_REQUIRED=2.33.3
XRANDR_REQUIRED=1.3
GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.1.4
XEXT_REQUIRED=1.1
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index 351dd43..40b36ec 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
@@ -49,7 +49,7 @@
struct _GnomeDesktopThumbnailFactoryPrivate {
GnomeDesktopThumbnailSize size;
- GMutex *lock;
+ GMutex lock;
GList *thumbnailers;
GHashTable *mime_types_map;
@@ -451,11 +451,7 @@ gnome_desktop_thumbnail_factory_finalize (GObject *object)
priv->monitors = NULL;
}
- if (priv->lock)
- {
- g_mutex_free (priv->lock);
- priv->lock = NULL;
- }
+ g_mutex_clear (&priv->lock);
if (priv->disabled_types)
{
@@ -540,7 +536,7 @@ update_or_create_thumbnailer (GnomeDesktopThumbnailFactory *factory,
Thumbnailer *thumb;
gboolean found = FALSE;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
for (l = priv->thumbnailers; l && !found; l = g_list_next (l))
{
@@ -568,7 +564,7 @@ update_or_create_thumbnailer (GnomeDesktopThumbnailFactory *factory,
gnome_desktop_thumbnail_factory_add_thumbnailer (factory, thumb);
}
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
static void
@@ -579,7 +575,7 @@ remove_thumbnailer (GnomeDesktopThumbnailFactory *factory,
GList *l;
Thumbnailer *thumb;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
for (l = priv->thumbnailers; l; l = g_list_next (l))
{
@@ -597,7 +593,7 @@ remove_thumbnailer (GnomeDesktopThumbnailFactory *factory,
}
}
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
static void
@@ -699,7 +695,7 @@ external_thumbnailers_disabled_all_changed_cb (GSettings *set
{
GnomeDesktopThumbnailFactoryPrivate *priv = factory->priv;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->disabled = g_settings_get_boolean (priv->settings, "disable-all");
if (priv->disabled)
@@ -713,7 +709,7 @@ external_thumbnailers_disabled_all_changed_cb (GSettings *set
gnome_desktop_thumbnail_factory_load_thumbnailers (factory);
}
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
static void
@@ -723,14 +719,14 @@ external_thumbnailers_disabled_changed_cb (GSettings *setting
{
GnomeDesktopThumbnailFactoryPrivate *priv = factory->priv;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
if (priv->disabled)
return;
g_strfreev (priv->disabled_types);
priv->disabled_types = g_settings_get_strv (priv->settings, "disable");
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
static void
@@ -749,7 +745,7 @@ gnome_desktop_thumbnail_factory_init (GnomeDesktopThumbnailFactory *factory)
(GDestroyNotify)g_free,
(GDestroyNotify)thumbnailer_unref);
- priv->lock = g_mutex_new ();
+ g_mutex_init (&priv->lock);
priv->settings = g_settings_new ("org.gnome.desktop.thumbnailers");
priv->disabled = g_settings_get_boolean (priv->settings, "disable-all");
@@ -1004,7 +1000,7 @@ gnome_desktop_thumbnail_factory_can_thumbnail (GnomeDesktopThumbnailFactory *fac
if (!mime_type)
return FALSE;
- g_mutex_lock (factory->priv->lock);
+ g_mutex_lock (&factory->priv->lock);
if (!gnome_desktop_thumbnail_factory_is_disabled (factory, mime_type))
{
Thumbnailer *thumb;
@@ -1012,7 +1008,7 @@ gnome_desktop_thumbnail_factory_can_thumbnail (GnomeDesktopThumbnailFactory *fac
thumb = g_hash_table_lookup (factory->priv->mime_types_map, mime_type);
have_script = thumbnailer_try_exec (thumb);
}
- g_mutex_unlock (factory->priv->lock);
+ g_mutex_unlock (&factory->priv->lock);
if (have_script || mimetype_supported_by_gdk_pixbuf (mime_type))
{
@@ -1135,7 +1131,7 @@ gnome_desktop_thumbnail_factory_generate_thumbnail (GnomeDesktopThumbnailFactory
pixbuf = NULL;
script = NULL;
- g_mutex_lock (factory->priv->lock);
+ g_mutex_lock (&factory->priv->lock);
if (!gnome_desktop_thumbnail_factory_is_disabled (factory, mime_type))
{
Thumbnailer *thumb;
@@ -1144,7 +1140,7 @@ gnome_desktop_thumbnail_factory_generate_thumbnail (GnomeDesktopThumbnailFactory
if (thumb)
script = g_strdup (thumb->command);
}
- g_mutex_unlock (factory->priv->lock);
+ g_mutex_unlock (&factory->priv->lock);
if (script)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]