[evolution-data-server] [ESourceExtension] Provide common property lock



commit 29bb5163aa4868c9cd10422f66060d0bd237cd98
Author: Milan Crha <mcrha redhat com>
Date:   Tue Mar 24 08:16:59 2015 +0100

    [ESourceExtension] Provide common property lock
    
    Having the property lock in the base structure helps to avoid duplication
    of the lock creation and management in the descendants.

 libedataserver/e-source-alarms.c           |   14 ++---
 libedataserver/e-source-authentication.c   |   64 ++++++++++-----------
 libedataserver/e-source-backend.c          |   14 ++---
 libedataserver/e-source-collection.c       |   14 ++---
 libedataserver/e-source-extension.c        |   36 ++++++++++++
 libedataserver/e-source-extension.h        |    4 +
 libedataserver/e-source-goa.c              |   34 +++++------
 libedataserver/e-source-ldap.c             |   24 +++-----
 libedataserver/e-source-local.c            |   26 ++-------
 libedataserver/e-source-mail-account.c     |   24 +++-----
 libedataserver/e-source-mail-composition.c |   44 +++++++--------
 libedataserver/e-source-mail-identity.c    |   54 ++++++++----------
 libedataserver/e-source-mail-signature.c   |   14 ++---
 libedataserver/e-source-mail-submission.c  |   24 +++-----
 libedataserver/e-source-openpgp.c          |   24 +++-----
 libedataserver/e-source-proxy.c            |   85 +++++++++++++---------------
 libedataserver/e-source-resource.c         |   14 ++---
 libedataserver/e-source-security.c         |   14 ++---
 libedataserver/e-source-selectable.c       |   14 ++---
 libedataserver/e-source-smime.c            |   34 +++++------
 libedataserver/e-source-weather.c          |   14 ++---
 libedataserver/e-source-webdav.c           |   70 +++++++++++------------
 22 files changed, 303 insertions(+), 356 deletions(-)
---
diff --git a/libedataserver/e-source-alarms.c b/libedataserver/e-source-alarms.c
index 9c67ad0..6363c35 100644
--- a/libedataserver/e-source-alarms.c
+++ b/libedataserver/e-source-alarms.c
@@ -40,7 +40,6 @@
        ((obj), E_TYPE_SOURCE_ALARMS, ESourceAlarmsPrivate))
 
 struct _ESourceAlarmsPrivate {
-       GMutex property_lock;
        gboolean include_me;
        gchar *last_notified;
 };
@@ -111,8 +110,6 @@ source_alarms_finalize (GObject *object)
 
        priv = E_SOURCE_ALARMS_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->last_notified);
 
        /* Chain up to parent's finalize() method. */
@@ -166,7 +163,6 @@ static void
 e_source_alarms_init (ESourceAlarms *extension)
 {
        extension->priv = E_SOURCE_ALARMS_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -260,12 +256,12 @@ e_source_alarms_dup_last_notified (ESourceAlarms *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_ALARMS (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_alarms_get_last_notified (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -308,17 +304,17 @@ e_source_alarms_set_last_notified (ESourceAlarms *extension,
                }
        }
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->last_notified, last_notified) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->last_notified);
        extension->priv->last_notified = g_strdup (last_notified);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "last-notified");
 }
diff --git a/libedataserver/e-source-authentication.c b/libedataserver/e-source-authentication.c
index 0784af9..3da9f67 100644
--- a/libedataserver/e-source-authentication.c
+++ b/libedataserver/e-source-authentication.c
@@ -43,7 +43,6 @@
        ((obj), E_TYPE_SOURCE_AUTHENTICATION, ESourceAuthenticationPrivate))
 
 struct _ESourceAuthenticationPrivate {
-       GMutex property_lock;
        gchar *host;
        gchar *method;
        guint16 port;
@@ -235,8 +234,6 @@ source_authentication_finalize (GObject *object)
 
        priv = E_SOURCE_AUTHENTICATION_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->host);
        g_free (priv->method);
        g_free (priv->proxy_uid);
@@ -374,7 +371,6 @@ static void
 e_source_authentication_init (ESourceAuthentication *extension)
 {
        extension->priv = E_SOURCE_AUTHENTICATION_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -425,12 +421,12 @@ e_source_authentication_ref_connectable (ESourceAuthentication *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_AUTHENTICATION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (extension->priv->connectable != NULL)
                connectable = g_object_ref (extension->priv->connectable);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return connectable;
 }
@@ -474,12 +470,12 @@ e_source_authentication_dup_host (ESourceAuthentication *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_AUTHENTICATION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_authentication_get_host (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -503,10 +499,10 @@ e_source_authentication_set_host (ESourceAuthentication *extension,
 {
        g_return_if_fail (E_IS_SOURCE_AUTHENTICATION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->host, host) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -515,7 +511,7 @@ e_source_authentication_set_host (ESourceAuthentication *extension,
 
        source_authentication_update_connectable (extension);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "host");
 
@@ -565,12 +561,12 @@ e_source_authentication_dup_method (ESourceAuthentication *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_AUTHENTICATION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_authentication_get_method (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -595,10 +591,10 @@ e_source_authentication_set_method (ESourceAuthentication *extension,
 {
        g_return_if_fail (E_IS_SOURCE_AUTHENTICATION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->method, method) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -608,7 +604,7 @@ e_source_authentication_set_method (ESourceAuthentication *extension,
        if (extension->priv->method == NULL)
                extension->priv->method = g_strdup ("none");
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "method");
 }
@@ -646,10 +642,10 @@ e_source_authentication_set_port (ESourceAuthentication *extension,
 {
        g_return_if_fail (E_SOURCE_AUTHENTICATION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (extension->priv->port == port) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -657,7 +653,7 @@ e_source_authentication_set_port (ESourceAuthentication *extension,
 
        source_authentication_update_connectable (extension);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "port");
 
@@ -705,12 +701,12 @@ e_source_authentication_dup_proxy_uid (ESourceAuthentication *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_AUTHENTICATION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_authentication_get_proxy_uid (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -732,17 +728,17 @@ e_source_authentication_set_proxy_uid (ESourceAuthentication *extension,
        g_return_if_fail (E_IS_SOURCE_AUTHENTICATION (extension));
        g_return_if_fail (proxy_uid != NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (proxy_uid, extension->priv->proxy_uid) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->proxy_uid);
        extension->priv->proxy_uid = g_strdup (proxy_uid);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "proxy-uid");
 }
@@ -831,12 +827,12 @@ e_source_authentication_dup_user (ESourceAuthentication *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_AUTHENTICATION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_authentication_get_user (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -860,17 +856,17 @@ e_source_authentication_set_user (ESourceAuthentication *extension,
 {
        g_return_if_fail (E_IS_SOURCE_AUTHENTICATION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->user, user) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->user);
        extension->priv->user = e_util_strdup_strip (user);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "user");
 }
@@ -917,12 +913,12 @@ e_source_authentication_dup_credential_name (ESourceAuthentication *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_AUTHENTICATION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_authentication_get_credential_name (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -949,17 +945,17 @@ e_source_authentication_set_credential_name (ESourceAuthentication *extension,
 {
        g_return_if_fail (E_IS_SOURCE_AUTHENTICATION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->credential_name, credential_name) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->credential_name);
        extension->priv->credential_name = e_util_strdup_strip (credential_name);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "credential-name");
 }
diff --git a/libedataserver/e-source-backend.c b/libedataserver/e-source-backend.c
index b9d6aef..8716a47 100644
--- a/libedataserver/e-source-backend.c
+++ b/libedataserver/e-source-backend.c
@@ -34,7 +34,6 @@
        ((obj), E_TYPE_SOURCE_BACKEND, ESourceBackendPrivate))
 
 struct _ESourceBackendPrivate {
-       GMutex property_lock;
        gchar *backend_name;
 };
 
@@ -90,8 +89,6 @@ source_backend_finalize (GObject *object)
 
        priv = E_SOURCE_BACKEND_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->backend_name);
 
        /* Chain up to parent's finalize() method. */
@@ -131,7 +128,6 @@ static void
 e_source_backend_init (ESourceBackend *extension)
 {
        extension->priv = E_SOURCE_BACKEND_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -173,12 +169,12 @@ e_source_backend_dup_backend_name (ESourceBackend *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_BACKEND (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_backend_get_backend_name (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -202,17 +198,17 @@ e_source_backend_set_backend_name (ESourceBackend *extension,
 {
        g_return_if_fail (E_IS_SOURCE_BACKEND (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->backend_name, backend_name) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->backend_name);
        extension->priv->backend_name = e_util_strdup_strip (backend_name);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "backend-name");
 }
diff --git a/libedataserver/e-source-collection.c b/libedataserver/e-source-collection.c
index 9ae5a78..0347a5b 100644
--- a/libedataserver/e-source-collection.c
+++ b/libedataserver/e-source-collection.c
@@ -49,7 +49,6 @@
        ((obj), E_TYPE_SOURCE_COLLECTION, ESourceCollectionPrivate))
 
 struct _ESourceCollectionPrivate {
-       GMutex property_lock;
        gchar *identity;
        gboolean calendar_enabled;
        gboolean contacts_enabled;
@@ -150,8 +149,6 @@ source_collection_finalize (GObject *object)
 
        priv = E_SOURCE_COLLECTION_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->identity);
 
        /* Chain up to parent's finalize() method. */
@@ -232,7 +229,6 @@ static void
 e_source_collection_init (ESourceCollection *extension)
 {
        extension->priv = E_SOURCE_COLLECTION_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -275,12 +271,12 @@ e_source_collection_dup_identity (ESourceCollection *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_COLLECTION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_collection_get_identity (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -305,17 +301,17 @@ e_source_collection_set_identity (ESourceCollection *extension,
 {
        g_return_if_fail (E_IS_SOURCE_COLLECTION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->identity, identity) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->identity);
        extension->priv->identity = e_util_strdup_strip (identity);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "identity");
 }
diff --git a/libedataserver/e-source-extension.c b/libedataserver/e-source-extension.c
index d84fe6f..46a8316 100644
--- a/libedataserver/e-source-extension.c
+++ b/libedataserver/e-source-extension.c
@@ -36,6 +36,7 @@
 
 struct _ESourceExtensionPrivate {
        GWeakRef source;
+       GRecMutex property_lock;
 };
 
 enum {
@@ -112,6 +113,7 @@ source_extension_finalize (GObject *object)
        priv = E_SOURCE_EXTENSION_GET_PRIVATE (object);
 
        g_weak_ref_clear (&priv->source);
+       g_rec_mutex_clear (&priv->property_lock);
 
        /* Chain up to parent's finalize() method. */
        G_OBJECT_CLASS (e_source_extension_parent_class)->finalize (object);
@@ -166,6 +168,7 @@ e_source_extension_init (ESourceExtension *extension)
 {
        extension->priv = E_SOURCE_EXTENSION_GET_PRIVATE (extension);
        g_weak_ref_init (&extension->priv->source, NULL);
+       g_rec_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -222,3 +225,36 @@ e_source_extension_get_source (ESourceExtension *extension)
        return source;
 }
 
+/**
+ * e_source_extension_property_lock:
+ * @extension: an #ESourceExtension
+ *
+ * Acquires a property lock, thus no other thread can change properties
+ * of the @extension until the lock is released.
+ *
+ * Since: 3.18
+ **/
+void
+e_source_extension_property_lock (ESourceExtension *extension)
+{
+       g_return_if_fail (E_IS_SOURCE_EXTENSION (extension));
+
+       g_rec_mutex_lock (&extension->priv->property_lock);
+}
+
+/**
+ * e_source_extension_property_unlock:
+ * @extension: an #ESourceExtension
+ *
+ * Releases a property lock, previously acquired with e_source_extension_property_lock(),
+ * thus other threads can change properties of the @extension.
+ *
+ * Since: 3.18
+ **/
+void
+e_source_extension_property_unlock (ESourceExtension *extension)
+{
+       g_return_if_fail (E_IS_SOURCE_EXTENSION (extension));
+
+       g_rec_mutex_unlock (&extension->priv->property_lock);
+}
diff --git a/libedataserver/e-source-extension.h b/libedataserver/e-source-extension.h
index e08993b..2c7ad2c 100644
--- a/libedataserver/e-source-extension.h
+++ b/libedataserver/e-source-extension.h
@@ -70,6 +70,10 @@ struct _ESourceExtensionClass {
 
 GType          e_source_extension_get_type     (void) G_GNUC_CONST;
 ESource *      e_source_extension_ref_source   (ESourceExtension *extension);
+void           e_source_extension_property_lock
+                                               (ESourceExtension *extension);
+void           e_source_extension_property_unlock
+                                               (ESourceExtension *extension);
 
 #ifndef EDS_DISABLE_DEPRECATED
 ESource *      e_source_extension_get_source   (ESourceExtension *extension);
diff --git a/libedataserver/e-source-goa.c b/libedataserver/e-source-goa.c
index c1946d4..980e915 100644
--- a/libedataserver/e-source-goa.c
+++ b/libedataserver/e-source-goa.c
@@ -44,7 +44,6 @@
        ((obj), E_TYPE_SOURCE_GOA, ESourceGoaPrivate))
 
 struct _ESourceGoaPrivate {
-       GMutex property_lock;
        gchar *account_id;
        gchar *calendar_url;
        gchar *contacts_url;
@@ -130,8 +129,6 @@ source_goa_finalize (GObject *object)
 
        priv = E_SOURCE_GOA_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->account_id);
        g_free (priv->calendar_url);
        g_free (priv->contacts_url);
@@ -200,7 +197,6 @@ static void
 e_source_goa_init (ESourceGoa *extension)
 {
        extension->priv = E_SOURCE_GOA_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -243,12 +239,12 @@ e_source_goa_dup_account_id (ESourceGoa *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_GOA (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_goa_get_account_id (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -273,17 +269,17 @@ e_source_goa_set_account_id (ESourceGoa *extension,
 {
        g_return_if_fail (E_IS_SOURCE_GOA (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->account_id, account_id) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->account_id);
        extension->priv->account_id = e_util_strdup_strip (account_id);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "account-id");
 }
@@ -329,12 +325,12 @@ e_source_goa_dup_calendar_url (ESourceGoa *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_GOA (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_goa_get_calendar_url (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -360,17 +356,17 @@ e_source_goa_set_calendar_url (ESourceGoa *extension,
 {
        g_return_if_fail (E_IS_SOURCE_GOA (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->calendar_url, calendar_url) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->calendar_url);
        extension->priv->calendar_url = e_util_strdup_strip (calendar_url);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "calendar-url");
 }
@@ -416,12 +412,12 @@ e_source_goa_dup_contacts_url (ESourceGoa *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_GOA (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_goa_get_contacts_url (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -447,17 +443,17 @@ e_source_goa_set_contacts_url (ESourceGoa *extension,
 {
        g_return_if_fail (E_IS_SOURCE_GOA (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->contacts_url, contacts_url) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->contacts_url);
        extension->priv->contacts_url = e_util_strdup_strip (contacts_url);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "contacts-url");
 }
diff --git a/libedataserver/e-source-ldap.c b/libedataserver/e-source-ldap.c
index 84a9f01..6096d20 100644
--- a/libedataserver/e-source-ldap.c
+++ b/libedataserver/e-source-ldap.c
@@ -32,7 +32,6 @@
        ((obj), E_TYPE_SOURCE_LDAP, ESourceLDAPPrivate))
 
 struct _ESourceLDAPPrivate {
-       GMutex property_lock;
        gboolean can_browse;
        gchar *filter;
        guint limit;
@@ -291,8 +290,6 @@ source_ldap_finalize (GObject *object)
 
        priv = E_SOURCE_LDAP_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->filter);
        g_free (priv->root_dn);
 
@@ -450,7 +447,6 @@ static void
 e_source_ldap_init (ESourceLDAP *extension)
 {
        extension->priv = E_SOURCE_LDAP_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 ESourceLDAPAuthentication
@@ -513,12 +509,12 @@ e_source_ldap_dup_filter (ESourceLDAP *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_LDAP (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_ldap_get_filter (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -537,7 +533,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension,
                !g_str_has_prefix (filter, "(") &&
                !g_str_has_suffix (filter, ")");
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (needs_parens)
                new_filter = g_strdup_printf ("(%s)", filter);
@@ -545,7 +541,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension,
                new_filter = g_strdup (filter);
 
        if (g_strcmp0 (extension->priv->filter, new_filter) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                g_free (new_filter);
                return;
        }
@@ -553,7 +549,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension,
        g_free (extension->priv->filter);
        extension->priv->filter = new_filter;
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "filter");
 }
@@ -596,12 +592,12 @@ e_source_ldap_dup_root_dn (ESourceLDAP *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_LDAP (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_ldap_get_root_dn (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -612,17 +608,17 @@ e_source_ldap_set_root_dn (ESourceLDAP *extension,
 {
        g_return_if_fail (E_IS_SOURCE_LDAP (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->root_dn, root_dn) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->root_dn);
        extension->priv->root_dn = e_util_strdup_strip (root_dn);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "root-dn");
 }
diff --git a/libedataserver/e-source-local.c b/libedataserver/e-source-local.c
index e65f5db..f39564f 100644
--- a/libedataserver/e-source-local.c
+++ b/libedataserver/e-source-local.c
@@ -26,7 +26,6 @@
        ((obj), E_TYPE_SOURCE_LOCAL, ESourceLocalPrivate))
 
 struct _ESourceLocalPrivate {
-       GMutex property_lock;
        GFile *custom_file;
 };
 
@@ -76,7 +75,7 @@ source_local_get_property (GObject *object,
 }
 
 static void
-source_local_dispose (GObject *object)
+source_local_finalize (GObject *object)
 {
        ESourceLocalPrivate *priv;
 
@@ -87,19 +86,6 @@ source_local_dispose (GObject *object)
                priv->custom_file = NULL;
        }
 
-       /* Chain up to parent's dispose() method. */
-       G_OBJECT_CLASS (e_source_local_parent_class)->dispose (object);
-}
-
-static void
-source_local_finalize (GObject *object)
-{
-       ESourceLocalPrivate *priv;
-
-       priv = E_SOURCE_LOCAL_GET_PRIVATE (object);
-
-       g_mutex_clear (&priv->property_lock);
-
        /* Chain up to parent's finalize() method. */
        G_OBJECT_CLASS (e_source_local_parent_class)->finalize (object);
 }
@@ -115,7 +101,6 @@ e_source_local_class_init (ESourceLocalClass *class)
        object_class = G_OBJECT_CLASS (class);
        object_class->set_property = source_local_set_property;
        object_class->get_property = source_local_get_property;
-       object_class->dispose = source_local_dispose;
        object_class->finalize = source_local_finalize;
 
        extension_class = E_SOURCE_EXTENSION_CLASS (class);
@@ -138,7 +123,6 @@ static void
 e_source_local_init (ESourceLocal *extension)
 {
        extension->priv = E_SOURCE_LOCAL_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 GFile *
@@ -157,12 +141,12 @@ e_source_local_dup_custom_file (ESourceLocal *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_LOCAL (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_local_get_custom_file (extension);
        duplicate = (protected != NULL) ? g_file_dup (protected) : NULL;
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -178,14 +162,14 @@ e_source_local_set_custom_file (ESourceLocal *extension,
                g_object_ref (custom_file);
        }
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (extension->priv->custom_file != NULL)
                g_object_unref (extension->priv->custom_file);
 
        extension->priv->custom_file = custom_file;
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "custom-file");
 }
diff --git a/libedataserver/e-source-mail-account.c b/libedataserver/e-source-mail-account.c
index eae7693..1e0dce7 100644
--- a/libedataserver/e-source-mail-account.c
+++ b/libedataserver/e-source-mail-account.c
@@ -45,7 +45,6 @@
        ((obj), E_TYPE_SOURCE_MAIL_ACCOUNT, ESourceMailAccountPrivate))
 
 struct _ESourceMailAccountPrivate {
-       GMutex property_lock;
        gchar *identity_uid;
        gchar *archive_folder;
 };
@@ -116,8 +115,6 @@ source_mail_account_finalize (GObject *object)
 
        priv = E_SOURCE_MAIL_ACCOUNT_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->identity_uid);
        g_free (priv->archive_folder);
 
@@ -172,7 +169,6 @@ static void
 e_source_mail_account_init (ESourceMailAccount *extension)
 {
        extension->priv = E_SOURCE_MAIL_ACCOUNT_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -215,12 +211,12 @@ e_source_mail_account_dup_identity_uid (ESourceMailAccount *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_ACCOUNT (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_account_get_identity_uid (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -241,17 +237,17 @@ e_source_mail_account_set_identity_uid (ESourceMailAccount *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_ACCOUNT (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->identity_uid, identity_uid) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->identity_uid);
        extension->priv->identity_uid = g_strdup (identity_uid);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "identity-uid");
 }
@@ -296,12 +292,12 @@ e_source_mail_account_dup_archive_folder (ESourceMailAccount *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_ACCOUNT (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_account_get_archive_folder (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -326,17 +322,17 @@ e_source_mail_account_set_archive_folder (ESourceMailAccount *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_ACCOUNT (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->archive_folder, archive_folder) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->archive_folder);
        extension->priv->archive_folder = g_strdup (archive_folder);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "archive-folder");
 }
diff --git a/libedataserver/e-source-mail-composition.c b/libedataserver/e-source-mail-composition.c
index 5cfbb5c..d466a45 100644
--- a/libedataserver/e-source-mail-composition.c
+++ b/libedataserver/e-source-mail-composition.c
@@ -43,7 +43,6 @@
        ((obj), E_TYPE_SOURCE_MAIL_COMPOSITION, ESourceMailCompositionPrivate))
 
 struct _ESourceMailCompositionPrivate {
-       GMutex property_lock;
        gchar **bcc;
        gchar **cc;
        gchar *drafts_folder;
@@ -159,8 +158,6 @@ source_mail_composition_finalize (GObject *object)
 
        priv = E_SOURCE_MAIL_COMPOSITION_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_strfreev (priv->bcc);
        g_strfreev (priv->cc);
        g_free (priv->drafts_folder);
@@ -258,7 +255,6 @@ static void
 e_source_mail_composition_init (ESourceMailComposition *extension)
 {
        extension->priv = E_SOURCE_MAIL_COMPOSITION_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -306,12 +302,12 @@ e_source_mail_composition_dup_bcc (ESourceMailComposition *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_composition_get_bcc (extension);
        duplicate = g_strdupv ((gchar **) protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -333,17 +329,17 @@ e_source_mail_composition_set_bcc (ESourceMailComposition *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (e_util_strv_equal (bcc, extension->priv->bcc)) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_strfreev (extension->priv->bcc);
        extension->priv->bcc = g_strdupv ((gchar **) bcc);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "bcc");
 }
@@ -393,12 +389,12 @@ e_source_mail_composition_dup_cc (ESourceMailComposition *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_composition_get_cc (extension);
        duplicate = g_strdupv ((gchar **) protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -420,17 +416,17 @@ e_source_mail_composition_set_cc (ESourceMailComposition *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (e_util_strv_equal (cc, extension->priv->cc)) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_strfreev (extension->priv->cc);
        extension->priv->cc = g_strdupv ((gchar **) cc);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "cc");
 }
@@ -475,12 +471,12 @@ e_source_mail_composition_dup_drafts_folder (ESourceMailComposition *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_composition_get_drafts_folder (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -506,17 +502,17 @@ e_source_mail_composition_set_drafts_folder (ESourceMailComposition *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->drafts_folder, drafts_folder) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->drafts_folder);
        extension->priv->drafts_folder = e_util_strdup_strip (drafts_folder);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "drafts-folder");
 }
@@ -606,12 +602,12 @@ e_source_mail_composition_dup_templates_folder (ESourceMailComposition *extensio
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_composition_get_templates_folder (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -637,17 +633,17 @@ e_source_mail_composition_set_templates_folder (ESourceMailComposition *extensio
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->templates_folder, templates_folder) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->templates_folder);
        extension->priv->templates_folder = e_util_strdup_strip (templates_folder);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "templates-folder");
 }
diff --git a/libedataserver/e-source-mail-identity.c b/libedataserver/e-source-mail-identity.c
index 7d8cbb9..bd13ca7 100644
--- a/libedataserver/e-source-mail-identity.c
+++ b/libedataserver/e-source-mail-identity.c
@@ -44,7 +44,6 @@
        ((obj), E_TYPE_SOURCE_MAIL_IDENTITY, ESourceMailIdentityPrivate))
 
 struct _ESourceMailIdentityPrivate {
-       GMutex property_lock;
        gchar *address;
        gchar *name;
        gchar *organization;
@@ -160,8 +159,6 @@ source_mail_identity_finalize (GObject *object)
 
        priv = E_SOURCE_MAIL_IDENTITY_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->address);
        g_free (priv->name);
        g_free (priv->organization);
@@ -258,7 +255,6 @@ static void
 e_source_mail_identity_init (ESourceMailIdentity *extension)
 {
        extension->priv = E_SOURCE_MAIL_IDENTITY_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -301,12 +297,12 @@ e_source_mail_identity_dup_address (ESourceMailIdentity *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_identity_get_address (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -330,17 +326,17 @@ e_source_mail_identity_set_address (ESourceMailIdentity *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->address, address) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->address);
        extension->priv->address = e_util_strdup_strip (address);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "address");
 }
@@ -384,12 +380,12 @@ e_source_mail_identity_dup_name (ESourceMailIdentity *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_identity_get_name (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -413,11 +409,11 @@ e_source_mail_identity_set_name (ESourceMailIdentity *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (extension->priv->name != NULL &&
            g_strcmp0 (extension->priv->name, name) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -427,7 +423,7 @@ e_source_mail_identity_set_name (ESourceMailIdentity *extension,
        if (extension->priv->name == NULL)
                extension->priv->name = g_strdup (g_get_real_name ());
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "name");
 }
@@ -471,12 +467,12 @@ e_source_mail_identity_dup_organization (ESourceMailIdentity *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_identity_get_organization (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -500,17 +496,17 @@ e_source_mail_identity_set_organization (ESourceMailIdentity *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->organization, organization) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->organization);
        extension->priv->organization = e_util_strdup_strip (organization);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "organization");
 }
@@ -555,12 +551,12 @@ e_source_mail_identity_dup_reply_to (ESourceMailIdentity *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_identity_get_reply_to (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -585,17 +581,17 @@ e_source_mail_identity_set_reply_to (ESourceMailIdentity *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->reply_to, reply_to) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->reply_to);
        extension->priv->reply_to = e_util_strdup_strip (reply_to);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "reply-to");
 }
@@ -643,12 +639,12 @@ e_source_mail_identity_dup_signature_uid (ESourceMailIdentity *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_IDENTITY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_identity_get_signature_uid (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -677,17 +673,17 @@ e_source_mail_identity_set_signature_uid (ESourceMailIdentity *extension,
        if (signature_uid == NULL || *signature_uid == '\0')
                signature_uid = "none";
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->signature_uid, signature_uid) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->signature_uid);
        extension->priv->signature_uid = g_strdup (signature_uid);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "signature-uid");
 }
diff --git a/libedataserver/e-source-mail-signature.c b/libedataserver/e-source-mail-signature.c
index ef10b41..27b404c 100644
--- a/libedataserver/e-source-mail-signature.c
+++ b/libedataserver/e-source-mail-signature.c
@@ -49,7 +49,6 @@
 typedef struct _AsyncContext AsyncContext;
 
 struct _ESourceMailSignaturePrivate {
-       GMutex property_lock;
        GFile *file;
        gchar *mime_type;
 };
@@ -146,8 +145,6 @@ source_mail_signature_finalize (GObject *object)
 
        priv = E_SOURCE_MAIL_SIGNATURE_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->mime_type);
 
        /* Chain up to parent's finalize() method. */
@@ -234,7 +231,6 @@ static void
 e_source_mail_signature_init (ESourceMailSignature *extension)
 {
        extension->priv = E_SOURCE_MAIL_SIGNATURE_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -303,12 +299,12 @@ e_source_mail_signature_dup_mime_type (ESourceMailSignature *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_SIGNATURE (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_signature_get_mime_type (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -335,17 +331,17 @@ e_source_mail_signature_set_mime_type (ESourceMailSignature *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_SIGNATURE (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->mime_type, mime_type) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->mime_type);
        extension->priv->mime_type = e_util_strdup_strip (mime_type);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "mime-type");
 }
diff --git a/libedataserver/e-source-mail-submission.c b/libedataserver/e-source-mail-submission.c
index b475827..4039461 100644
--- a/libedataserver/e-source-mail-submission.c
+++ b/libedataserver/e-source-mail-submission.c
@@ -43,7 +43,6 @@
        ((obj), E_TYPE_SOURCE_MAIL_SUBMISSION, ESourceMailSubmissionPrivate))
 
 struct _ESourceMailSubmissionPrivate {
-       GMutex property_lock;
        gchar *sent_folder;
        gchar *transport_uid;
        gboolean replies_to_origin_folder;
@@ -129,8 +128,6 @@ source_mail_submission_finalize (GObject *object)
 
        priv = E_SOURCE_MAIL_SUBMISSION_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->sent_folder);
        g_free (priv->transport_uid);
 
@@ -201,7 +198,6 @@ static void
 e_source_mail_submission_init (ESourceMailSubmission *extension)
 {
        extension->priv = E_SOURCE_MAIL_SUBMISSION_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -244,12 +240,12 @@ e_source_mail_submission_dup_sent_folder (ESourceMailSubmission *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_SUBMISSION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_submission_get_sent_folder (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -275,17 +271,17 @@ e_source_mail_submission_set_sent_folder (ESourceMailSubmission *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_SUBMISSION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->sent_folder, sent_folder) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->sent_folder);
        extension->priv->sent_folder = e_util_strdup_strip (sent_folder);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "sent-folder");
 }
@@ -330,12 +326,12 @@ e_source_mail_submission_dup_transport_uid (ESourceMailSubmission *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_MAIL_SUBMISSION (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_mail_submission_get_transport_uid (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -356,17 +352,17 @@ e_source_mail_submission_set_transport_uid (ESourceMailSubmission *extension,
 {
        g_return_if_fail (E_IS_SOURCE_MAIL_SUBMISSION (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->transport_uid, transport_uid) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->transport_uid);
        extension->priv->transport_uid = g_strdup (transport_uid);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "transport-uid");
 }
diff --git a/libedataserver/e-source-openpgp.c b/libedataserver/e-source-openpgp.c
index ea8ce6c..cc8569f 100644
--- a/libedataserver/e-source-openpgp.c
+++ b/libedataserver/e-source-openpgp.c
@@ -43,7 +43,6 @@
        ((obj), E_TYPE_SOURCE_OPENPGP, ESourceOpenPGPPrivate))
 
 struct _ESourceOpenPGPPrivate {
-       GMutex property_lock;
        gchar *key_id;
        gchar *signing_algorithm;
 
@@ -160,8 +159,6 @@ source_openpgp_finalize (GObject *object)
 
        priv = E_SOURCE_OPENPGP_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->key_id);
        g_free (priv->signing_algorithm);
 
@@ -255,7 +252,6 @@ static void
 e_source_openpgp_init (ESourceOpenPGP *extension)
 {
        extension->priv = E_SOURCE_OPENPGP_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -381,12 +377,12 @@ e_source_openpgp_dup_key_id (ESourceOpenPGP *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_OPENPGP (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_openpgp_get_key_id (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -410,17 +406,17 @@ e_source_openpgp_set_key_id (ESourceOpenPGP *extension,
 {
        g_return_if_fail (E_IS_SOURCE_OPENPGP (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->key_id, key_id) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->key_id);
        extension->priv->key_id = e_util_strdup_strip (key_id);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "key-id");
 }
@@ -465,12 +461,12 @@ e_source_openpgp_dup_signing_algorithm (ESourceOpenPGP *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_OPENPGP (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_openpgp_get_signing_algorithm (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -495,10 +491,10 @@ e_source_openpgp_set_signing_algorithm (ESourceOpenPGP *extension,
 {
        g_return_if_fail (E_IS_SOURCE_OPENPGP (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->signing_algorithm, signing_algorithm) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -506,7 +502,7 @@ e_source_openpgp_set_signing_algorithm (ESourceOpenPGP *extension,
        extension->priv->signing_algorithm =
                e_util_strdup_strip (signing_algorithm);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "signing-algorithm");
 }
diff --git a/libedataserver/e-source-proxy.c b/libedataserver/e-source-proxy.c
index 941b078..4b5dd05 100644
--- a/libedataserver/e-source-proxy.c
+++ b/libedataserver/e-source-proxy.c
@@ -50,8 +50,6 @@
 typedef struct _AsyncContext AsyncContext;
 
 struct _ESourceProxyPrivate {
-       GMutex property_lock;
-
        EProxyMethod method;
        gchar *autoconfig_url;
        gchar **ignore_hosts;
@@ -422,8 +420,6 @@ source_proxy_finalize (GObject *object)
 
        priv = E_SOURCE_PROXY_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->autoconfig_url);
        g_strfreev (priv->ignore_hosts);
        g_free (priv->ftp_host);
@@ -642,7 +638,6 @@ static void
 e_source_proxy_init (ESourceProxy *extension)
 {
        extension->priv = E_SOURCE_PROXY_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -735,12 +730,12 @@ e_source_proxy_dup_autoconfig_url (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_autoconfig_url (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -762,17 +757,17 @@ e_source_proxy_set_autoconfig_url (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (autoconfig_url, extension->priv->autoconfig_url) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->autoconfig_url);
        extension->priv->autoconfig_url = e_util_strdup_strip (autoconfig_url);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "autoconfig-url");
 }
@@ -825,12 +820,12 @@ e_source_proxy_dup_ignore_hosts (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_ignore_hosts (extension);
        duplicate = g_strdupv ((gchar **) protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -853,10 +848,10 @@ e_source_proxy_set_ignore_hosts (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (e_util_strv_equal (ignore_hosts, extension->priv->ignore_hosts)) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -872,7 +867,7 @@ e_source_proxy_set_ignore_hosts (ESourceProxy *extension,
                        g_strstrip (extension->priv->ignore_hosts[ii]);
        }
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "ignore-hosts");
 }
@@ -917,12 +912,12 @@ e_source_proxy_dup_ftp_host (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_ftp_host (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -943,17 +938,17 @@ e_source_proxy_set_ftp_host (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (ftp_host, extension->priv->ftp_host) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->ftp_host);
        extension->priv->ftp_host = e_util_strdup_strip (ftp_host);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "ftp-host");
 }
@@ -1041,12 +1036,12 @@ e_source_proxy_dup_http_host (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_http_host (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1067,17 +1062,17 @@ e_source_proxy_set_http_host (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (http_host, extension->priv->http_host) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->http_host);
        extension->priv->http_host = e_util_strdup_strip (http_host);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "http-host");
 }
@@ -1216,12 +1211,12 @@ e_source_proxy_dup_http_auth_user (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_http_auth_user (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1242,17 +1237,17 @@ e_source_proxy_set_http_auth_user (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (http_auth_user, extension->priv->http_auth_user) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->http_auth_user);
        extension->priv->http_auth_user = e_util_strdup_strip (http_auth_user);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "http-auth-user");
 }
@@ -1297,12 +1292,12 @@ e_source_proxy_dup_http_auth_password (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_http_auth_password (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1323,17 +1318,17 @@ e_source_proxy_set_http_auth_password (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (http_auth_password, extension->priv->http_auth_password) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->http_auth_password);
        extension->priv->http_auth_password = e_util_strdup_strip (http_auth_password);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "http-auth-password");
 }
@@ -1378,12 +1373,12 @@ e_source_proxy_dup_https_host (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_https_host (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1404,17 +1399,17 @@ e_source_proxy_set_https_host (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (https_host, extension->priv->https_host) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->https_host);
        extension->priv->https_host = e_util_strdup_strip (https_host);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "https-host");
 }
@@ -1502,12 +1497,12 @@ e_source_proxy_dup_socks_host (ESourceProxy *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_PROXY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_proxy_get_socks_host (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1528,17 +1523,17 @@ e_source_proxy_set_socks_host (ESourceProxy *extension,
 {
        g_return_if_fail (E_IS_SOURCE_PROXY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (socks_host, extension->priv->socks_host) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->socks_host);
        extension->priv->socks_host = e_util_strdup_strip (socks_host);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "socks-host");
 }
diff --git a/libedataserver/e-source-resource.c b/libedataserver/e-source-resource.c
index 626a7a4..ea9bd63 100644
--- a/libedataserver/e-source-resource.c
+++ b/libedataserver/e-source-resource.c
@@ -49,7 +49,6 @@
        ((obj), E_TYPE_SOURCE_RESOURCE, ESourceResourcePrivate))
 
 struct _ESourceResourcePrivate {
-       GMutex property_lock;
        gchar *identity;
 };
 
@@ -105,8 +104,6 @@ source_resource_finalize (GObject *object)
 
        priv = E_SOURCE_RESOURCE_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->identity);
 
        /* Chain up to parent's finalize() method. */
@@ -147,7 +144,6 @@ static void
 e_source_resource_init (ESourceResource *extension)
 {
        extension->priv = E_SOURCE_RESOURCE_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -190,12 +186,12 @@ e_source_resource_dup_identity (ESourceResource *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_RESOURCE (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_resource_get_identity (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -220,17 +216,17 @@ e_source_resource_set_identity (ESourceResource *extension,
 {
        g_return_if_fail (E_IS_SOURCE_RESOURCE (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->identity, identity) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->identity);
        extension->priv->identity = e_util_strdup_strip (identity);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "identity");
 }
diff --git a/libedataserver/e-source-security.c b/libedataserver/e-source-security.c
index 393b31c..8e2366e 100644
--- a/libedataserver/e-source-security.c
+++ b/libedataserver/e-source-security.c
@@ -45,7 +45,6 @@
 #define SECURE_METHOD "tls"
 
 struct _ESourceSecurityPrivate {
-       GMutex property_lock;
        gchar *method;
 };
 
@@ -115,8 +114,6 @@ source_security_finalize (GObject *object)
 
        priv = E_SOURCE_SECURITY_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->method);
 
        /* Chain up to parent's finalize() method. */
@@ -168,7 +165,6 @@ static void
 e_source_security_init (ESourceSecurity *extension)
 {
        extension->priv = E_SOURCE_SECURITY_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -213,12 +209,12 @@ e_source_security_dup_method (ESourceSecurity *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_SECURITY (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_security_get_method (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -245,11 +241,11 @@ e_source_security_set_method (ESourceSecurity *extension,
 
        g_return_if_fail (E_IS_SOURCE_SECURITY (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (extension->priv->method &&
            g_strcmp0 (extension->priv->method, method) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -259,7 +255,7 @@ e_source_security_set_method (ESourceSecurity *extension,
        if (extension->priv->method == NULL)
                extension->priv->method = g_strdup ("none");
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        object = G_OBJECT (extension);
        g_object_freeze_notify (object);
diff --git a/libedataserver/e-source-selectable.c b/libedataserver/e-source-selectable.c
index 7c869bd..a9fb78a 100644
--- a/libedataserver/e-source-selectable.c
+++ b/libedataserver/e-source-selectable.c
@@ -34,7 +34,6 @@
        ((obj), E_TYPE_SOURCE_SELECTABLE, ESourceSelectablePrivate))
 
 struct _ESourceSelectablePrivate {
-       GMutex property_lock;
        gchar *color;
        gboolean selected;
 };
@@ -105,8 +104,6 @@ source_selectable_finalize (GObject *object)
 
        priv = E_SOURCE_SELECTABLE_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->color);
 
        /* Chain up to parent's finalize() method. */
@@ -159,7 +156,6 @@ static void
 e_source_selectable_init (ESourceSelectable *extension)
 {
        extension->priv = E_SOURCE_SELECTABLE_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -203,12 +199,12 @@ e_source_selectable_dup_color (ESourceSelectable *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_SELECTABLE (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_selectable_get_color (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -234,17 +230,17 @@ e_source_selectable_set_color (ESourceSelectable *extension,
 {
        g_return_if_fail (E_IS_SOURCE_SELECTABLE (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->color, color) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->color);
        extension->priv->color = e_util_strdup_strip (color);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "color");
 }
diff --git a/libedataserver/e-source-smime.c b/libedataserver/e-source-smime.c
index b647558..2b155ea 100644
--- a/libedataserver/e-source-smime.c
+++ b/libedataserver/e-source-smime.c
@@ -43,7 +43,6 @@
        ((obj), E_TYPE_SOURCE_SMIME, ESourceSMIMEPrivate))
 
 struct _ESourceSMIMEPrivate {
-       GMutex property_lock;
        gchar *encryption_certificate;
        gchar *signing_algorithm;
        gchar *signing_certificate;
@@ -175,8 +174,6 @@ source_smime_finalize (GObject *object)
 
        priv = E_SOURCE_SMIME_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->encryption_certificate);
        g_free (priv->signing_algorithm);
        g_free (priv->signing_certificate);
@@ -284,7 +281,6 @@ static void
 e_source_smime_init (ESourceSMIME *extension)
 {
        extension->priv = E_SOURCE_SMIME_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 /**
@@ -326,12 +322,12 @@ e_source_smime_dup_encryption_certificate (ESourceSMIME *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_SMIME (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_smime_get_encryption_certificate (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -354,12 +350,12 @@ e_source_smime_set_encryption_certificate (ESourceSMIME *extension,
 {
        g_return_if_fail (E_IS_SOURCE_SMIME (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (
                extension->priv->encryption_certificate,
                encryption_certificate) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -369,7 +365,7 @@ e_source_smime_set_encryption_certificate (ESourceSMIME *extension,
        g_free (extension->priv->encryption_certificate);
        extension->priv->encryption_certificate = g_strdup (encryption_certificate);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "encryption-certificate");
 }
@@ -498,12 +494,12 @@ e_source_smime_dup_signing_algorithm (ESourceSMIME *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_SMIME (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_smime_get_signing_algorithm (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -529,10 +525,10 @@ e_source_smime_set_signing_algorithm (ESourceSMIME *extension,
 {
        g_return_if_fail (E_IS_SOURCE_SMIME (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->signing_algorithm, signing_algorithm) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -540,7 +536,7 @@ e_source_smime_set_signing_algorithm (ESourceSMIME *extension,
        extension->priv->signing_algorithm =
                e_util_strdup_strip (signing_algorithm);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "signing-algorithm");
 }
@@ -584,12 +580,12 @@ e_source_smime_dup_signing_certificate (ESourceSMIME *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_SMIME (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_smime_get_signing_certificate (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -612,10 +608,10 @@ e_source_smime_set_signing_certificate (ESourceSMIME *extension,
 {
        g_return_if_fail (E_IS_SOURCE_SMIME (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->signing_certificate, signing_certificate) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
@@ -625,7 +621,7 @@ e_source_smime_set_signing_certificate (ESourceSMIME *extension,
        g_free (extension->priv->signing_certificate);
        extension->priv->signing_certificate = g_strdup (signing_certificate);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "signing-certificate");
 }
diff --git a/libedataserver/e-source-weather.c b/libedataserver/e-source-weather.c
index 4788a7a..47c5da1 100644
--- a/libedataserver/e-source-weather.c
+++ b/libedataserver/e-source-weather.c
@@ -27,7 +27,6 @@
        ((obj), E_TYPE_SOURCE_WEATHER, ESourceWeatherPrivate))
 
 struct _ESourceWeatherPrivate {
-       GMutex property_lock;
        ESourceWeatherUnits units;
        gchar *location;
 };
@@ -98,8 +97,6 @@ source_weather_finalize (GObject *object)
 
        priv = E_SOURCE_WEATHER_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->location);
 
        /* Chain up to parent's finalize() method. */
@@ -152,7 +149,6 @@ static void
 e_source_weather_init (ESourceWeather *extension)
 {
        extension->priv = E_SOURCE_WEATHER_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 }
 
 const gchar *
@@ -171,12 +167,12 @@ e_source_weather_dup_location (ESourceWeather *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_WEATHER (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_weather_get_location (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -187,17 +183,17 @@ e_source_weather_set_location (ESourceWeather *extension,
 {
        g_return_if_fail (E_IS_SOURCE_WEATHER (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->location, location) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->location);
        extension->priv->location = e_util_strdup_strip (location);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "location");
 }
diff --git a/libedataserver/e-source-webdav.c b/libedataserver/e-source-webdav.c
index fd31993..3a95bf9 100644
--- a/libedataserver/e-source-webdav.c
+++ b/libedataserver/e-source-webdav.c
@@ -63,7 +63,6 @@
        ((obj), E_TYPE_SOURCE_WEBDAV, ESourceWebdavPrivate))
 
 struct _ESourceWebdavPrivate {
-       GMutex property_lock;
        gchar *display_name;
        gchar *email_address;
        gchar *resource_path;
@@ -150,9 +149,9 @@ source_webdav_update_properties_from_soup_uri (ESourceWebdav *webdav_extension)
 
        /* Do not use e_source_webdav_dup_soup_uri() here.  That
         * builds the URI from properties we haven't yet updated. */
-       g_mutex_lock (&webdav_extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (webdav_extension));
        soup_uri = soup_uri_copy (webdav_extension->priv->soup_uri);
-       g_mutex_unlock (&webdav_extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (webdav_extension));
 
        extension = E_SOURCE_EXTENSION (webdav_extension);
        source = e_source_extension_ref_source (extension);
@@ -234,7 +233,7 @@ source_webdav_update_soup_uri_from_properties (ESourceWebdav *webdav_extension)
 
        g_object_unref (source);
 
-       g_mutex_lock (&webdav_extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (webdav_extension));
 
        soup_uri = webdav_extension->priv->soup_uri;
 
@@ -256,7 +255,7 @@ source_webdav_update_soup_uri_from_properties (ESourceWebdav *webdav_extension)
 
        soup_uri_set_query (soup_uri, query);
 
-       g_mutex_unlock (&webdav_extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (webdav_extension));
 
        g_free (user);
        g_free (host);
@@ -397,8 +396,6 @@ source_webdav_finalize (GObject *object)
 
        priv = E_SOURCE_WEBDAV_GET_PRIVATE (object);
 
-       g_mutex_clear (&priv->property_lock);
-
        g_free (priv->display_name);
        g_free (priv->email_address);
        g_free (priv->resource_path);
@@ -590,7 +587,6 @@ static void
 e_source_webdav_init (ESourceWebdav *extension)
 {
        extension->priv = E_SOURCE_WEBDAV_GET_PRIVATE (extension);
-       g_mutex_init (&extension->priv->property_lock);
 
        /* Initialize this enough for SOUP_URI_IS_VALID() to pass. */
        extension->priv->soup_uri = soup_uri_new (NULL);
@@ -740,12 +736,12 @@ e_source_webdav_dup_display_name (ESourceWebdav *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_webdav_get_display_name (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -772,17 +768,17 @@ e_source_webdav_set_display_name (ESourceWebdav *extension,
 {
        g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->display_name, display_name) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->display_name);
        extension->priv->display_name = e_util_strdup_strip (display_name);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "display-name");
 }
@@ -827,12 +823,12 @@ e_source_webdav_dup_email_address (ESourceWebdav *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_webdav_get_email_address (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -857,17 +853,17 @@ e_source_webdav_set_email_address (ESourceWebdav *extension,
 {
        g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->email_address, email_address) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->email_address);
        extension->priv->email_address = e_util_strdup_strip (email_address);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "email-address");
 }
@@ -911,12 +907,12 @@ e_source_webdav_dup_resource_path (ESourceWebdav *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_webdav_get_resource_path (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -941,17 +937,17 @@ e_source_webdav_set_resource_path (ESourceWebdav *extension,
 {
        g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->resource_path, resource_path) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->resource_path);
        extension->priv->resource_path = e_util_strdup_strip (resource_path);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "resource-path");
 }
@@ -1000,12 +996,12 @@ e_source_webdav_dup_resource_query (ESourceWebdav *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_webdav_get_resource_query (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1035,17 +1031,17 @@ e_source_webdav_set_resource_query (ESourceWebdav *extension,
 {
        g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->resource_query, resource_query) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->resource_query);
        extension->priv->resource_query = e_util_strdup_strip (resource_query);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "resource-query");
 }
@@ -1096,12 +1092,12 @@ e_source_webdav_dup_ssl_trust (ESourceWebdav *extension)
 
        g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        protected = e_source_webdav_get_ssl_trust (extension);
        duplicate = g_strdup (protected);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1122,17 +1118,17 @@ e_source_webdav_set_ssl_trust (ESourceWebdav *extension,
 {
        g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        if (g_strcmp0 (extension->priv->ssl_trust, ssl_trust) == 0) {
-               g_mutex_unlock (&extension->priv->property_lock);
+               e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
                return;
        }
 
        g_free (extension->priv->ssl_trust);
        extension->priv->ssl_trust = g_strdup (ssl_trust);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_notify (G_OBJECT (extension), "ssl-trust");
 }
@@ -1160,11 +1156,11 @@ e_source_webdav_dup_soup_uri (ESourceWebdav *extension)
        /* Keep this outside of the property lock. */
        source_webdav_update_soup_uri_from_properties (extension);
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        duplicate = soup_uri_copy (extension->priv->soup_uri);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        return duplicate;
 }
@@ -1188,7 +1184,7 @@ e_source_webdav_set_soup_uri (ESourceWebdav *extension,
        g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
        g_return_if_fail (SOUP_URI_IS_VALID (soup_uri));
 
-       g_mutex_lock (&extension->priv->property_lock);
+       e_source_extension_property_lock (E_SOURCE_EXTENSION (extension));
 
        /* Do not test for URI equality because our
         * internal SoupURI might not be up-to-date. */
@@ -1196,7 +1192,7 @@ e_source_webdav_set_soup_uri (ESourceWebdav *extension,
        soup_uri_free (extension->priv->soup_uri);
        extension->priv->soup_uri = soup_uri_copy (soup_uri);
 
-       g_mutex_unlock (&extension->priv->property_lock);
+       e_source_extension_property_unlock (E_SOURCE_EXTENSION (extension));
 
        g_object_freeze_notify (G_OBJECT (extension));
        source_webdav_update_properties_from_soup_uri (extension);



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