[evolution-kolab/ek-wip-porting: 35/36] CamelKolabIMAPXStore: GLib 2.32 GMutex fixups



commit 2d6b068968e87051fb1e05140936efdc4b182714
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Jun 15 14:38:16 2012 +0200

    CamelKolabIMAPXStore: GLib 2.32 GMutex fixups
    
    * g_mutex_new() / g_mutex_free() have been deprecated
      in GLib 2.32 in favor of g_mutex_init() / g_mutex_clear()

 src/camel/camel-kolab-imapx-store.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/camel/camel-kolab-imapx-store.c b/src/camel/camel-kolab-imapx-store.c
index ecfb541..a5e4991 100644
--- a/src/camel/camel-kolab-imapx-store.c
+++ b/src/camel/camel-kolab-imapx-store.c
@@ -64,7 +64,7 @@ struct _CamelKolabIMAPXStorePrivate {
 	/* Used for syncronizing get_folder_info.
 	 * TODO check whether we can re-use any other lock
 	 */
-	GMutex *kolab_finfo_lock;
+	GMutex kolab_finfo_lock;
 
 	KolabFolderTypeID folder_create_type;
 	KolabFolderContextID folder_context;
@@ -100,7 +100,7 @@ camel_kolab_imapx_store_init (CamelKolabIMAPXStore *self)
 	priv = CAMEL_KOLAB_IMAPX_STORE_PRIVATE (self);
 
 	/* folder info lock */
-	priv->kolab_finfo_lock = g_mutex_new ();
+	g_mutex_init (&(priv->kolab_finfo_lock));
 
 	/* default folder type to create (for use in Evo) */
 	priv->folder_create_type = KOLAB_FOLDER_TYPE_EMAIL;
@@ -165,9 +165,9 @@ camel_kolab_imapx_store_finalize (GObject *object)
 	}
 	camel_kolab_imapx_metadata_free (priv->kmd);
 
-	while (! g_mutex_trylock (priv->kolab_finfo_lock));
-	g_mutex_unlock (priv->kolab_finfo_lock);
-	g_mutex_free (priv->kolab_finfo_lock);
+	while (! g_mutex_trylock (&(priv->kolab_finfo_lock)));
+	g_mutex_unlock (&(priv->kolab_finfo_lock));
+	g_mutex_clear (&(priv->kolab_finfo_lock));
 
 	if (priv->folder_names_do_care != NULL) {
 		GList *list_ptr = priv->folder_names_do_care;
@@ -588,7 +588,7 @@ kolab_imapx_store_get_folder_info_sync (CamelStore *self,
 	myself = CAMEL_KOLAB_IMAPX_STORE (self);
 	priv = CAMEL_KOLAB_IMAPX_STORE_PRIVATE (myself);
 
-	g_mutex_lock (priv->kolab_finfo_lock);
+	g_mutex_lock (&(priv->kolab_finfo_lock));
 
 	fi = parent_store_class->get_folder_info_sync (self,
 	                                               top,
@@ -608,7 +608,7 @@ kolab_imapx_store_get_folder_info_sync (CamelStore *self,
 	if (fi != NULL)
 		camel_store_free_folder_info (self, fi);
 
-	g_mutex_unlock (priv->kolab_finfo_lock);
+	g_mutex_unlock (&(priv->kolab_finfo_lock));
 
 	if (tmp_err != NULL) {
 		g_propagate_error (err, tmp_err);
@@ -847,12 +847,12 @@ kolab_imapx_store_resect_folder_list (CamelKolabIMAPXStore *self)
 
 	priv = CAMEL_KOLAB_IMAPX_STORE_PRIVATE (self);
 
-	g_mutex_lock (priv->kolab_finfo_lock);
+	g_mutex_lock (&(priv->kolab_finfo_lock));
 
 	folder_list = priv->folder_names_do_care;
 	priv->folder_names_do_care = NULL;
 
-	g_mutex_unlock (priv->kolab_finfo_lock);
+	g_mutex_unlock (&(priv->kolab_finfo_lock));
 
 	return folder_list;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]