From: Matthew Barnes Date: Fri, 30 Apr 2010 21:09:13 +0000 (-0400) Subject: Don't abbreviate public symbols. X-Git-Tag: upstream/3.7.4~3120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d2fed1ff34881923b7f9adc79eb798e665ca12a;p=platform%2Fupstream%2Fevolution-data-server.git Don't abbreviate public symbols. Public Camel symbols need to be in the "camel" namespace. --- diff --git a/camel/camel-certdb.c b/camel/camel-certdb.c index 68119ea..815bb16 100644 --- a/camel/camel-certdb.c +++ b/camel/camel-certdb.c @@ -185,12 +185,12 @@ camel_certdb_set_filename (CamelCertDB *certdb, const gchar *filename) g_return_if_fail (CAMEL_IS_CERTDB (certdb)); g_return_if_fail (filename != NULL); - camel_certdb_lock (certdb, CCD_DB_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_DB_LOCK); g_free (certdb->filename); certdb->filename = g_strdup (filename); - camel_certdb_unlock (certdb, CCD_DB_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK); } static gint @@ -250,7 +250,7 @@ camel_certdb_load (CamelCertDB *certdb) g_return_val_if_fail (class->header_load != NULL, -1); g_return_val_if_fail (class->cert_load != NULL, -1); - camel_certdb_lock (certdb, CCD_IO_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_IO_LOCK); if (class->header_load (certdb, in) == -1) goto error; @@ -263,7 +263,7 @@ camel_certdb_load (CamelCertDB *certdb) camel_certdb_add (certdb, cert); } - camel_certdb_unlock (certdb, CCD_IO_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_IO_LOCK); if (fclose (in) != 0) return -1; @@ -276,7 +276,7 @@ camel_certdb_load (CamelCertDB *certdb) g_warning ("Cannot load certificate database: %s", g_strerror (ferror (in))); - camel_certdb_unlock (certdb, CCD_IO_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_IO_LOCK); fclose (in); @@ -347,7 +347,7 @@ camel_certdb_save (CamelCertDB *certdb) g_return_val_if_fail (class->header_save != NULL, -1); g_return_val_if_fail (class->cert_save != NULL, -1); - camel_certdb_lock (certdb, CCD_IO_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_IO_LOCK); certdb->saved_certs = certdb->certs->len; if (class->header_save (certdb, out) == -1) @@ -360,7 +360,7 @@ camel_certdb_save (CamelCertDB *certdb) goto error; } - camel_certdb_unlock (certdb, CCD_IO_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_IO_LOCK); if (fflush (out) != 0 || fsync (fileno (out)) == -1) { i = errno; @@ -392,7 +392,7 @@ camel_certdb_save (CamelCertDB *certdb) g_warning ("Cannot save certificate database: %s", g_strerror (ferror (out))); - camel_certdb_unlock (certdb, CCD_IO_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_IO_LOCK); i = errno; fclose (out); @@ -417,13 +417,13 @@ camel_certdb_get_cert (CamelCertDB *certdb, const gchar *fingerprint) g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL); - camel_certdb_lock (certdb, CCD_DB_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_DB_LOCK); cert = g_hash_table_lookup (certdb->cert_hash, fingerprint); if (cert) camel_certdb_cert_ref (certdb, cert); - camel_certdb_unlock (certdb, CCD_DB_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK); return cert; } @@ -433,10 +433,10 @@ camel_certdb_add (CamelCertDB *certdb, CamelCert *cert) { g_return_if_fail (CAMEL_IS_CERTDB (certdb)); - camel_certdb_lock (certdb, CCD_DB_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_DB_LOCK); if (g_hash_table_lookup (certdb->cert_hash, cert->fingerprint)) { - camel_certdb_unlock (certdb, CCD_DB_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK); return; } @@ -446,7 +446,7 @@ camel_certdb_add (CamelCertDB *certdb, CamelCert *cert) certdb->flags |= CAMEL_CERTDB_DIRTY; - camel_certdb_unlock (certdb, CCD_DB_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK); } void @@ -454,7 +454,7 @@ camel_certdb_remove (CamelCertDB *certdb, CamelCert *cert) { g_return_if_fail (CAMEL_IS_CERTDB (certdb)); - camel_certdb_lock (certdb, CCD_DB_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_DB_LOCK); if (g_hash_table_lookup (certdb->cert_hash, cert->fingerprint)) { g_hash_table_remove (certdb->cert_hash, cert->fingerprint); @@ -464,7 +464,7 @@ camel_certdb_remove (CamelCertDB *certdb, CamelCert *cert) certdb->flags |= CAMEL_CERTDB_DIRTY; } - camel_certdb_unlock (certdb, CCD_DB_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK); } static CamelCert * @@ -493,11 +493,11 @@ camel_certdb_cert_new (CamelCertDB *certdb) class = CAMEL_CERTDB_GET_CLASS (certdb); g_return_val_if_fail (class->cert_new != NULL, NULL); - camel_certdb_lock (certdb, CCD_ALLOC_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_ALLOC_LOCK); cert = class->cert_new (certdb); - camel_certdb_unlock (certdb, CCD_ALLOC_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_ALLOC_LOCK); return cert; } @@ -508,9 +508,9 @@ camel_certdb_cert_ref (CamelCertDB *certdb, CamelCert *cert) g_return_if_fail (CAMEL_IS_CERTDB (certdb)); g_return_if_fail (cert != NULL); - camel_certdb_lock (certdb, CCD_REF_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_REF_LOCK); cert->refcount++; - camel_certdb_unlock (certdb, CCD_REF_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_REF_LOCK); } static void @@ -536,7 +536,7 @@ camel_certdb_cert_unref (CamelCertDB *certdb, class = CAMEL_CERTDB_GET_CLASS (certdb); g_return_if_fail (class->cert_free != NULL); - camel_certdb_lock (certdb, CCD_REF_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_REF_LOCK); if (cert->refcount <= 1) { class->cert_free (certdb, cert); @@ -548,7 +548,7 @@ camel_certdb_cert_unref (CamelCertDB *certdb, cert->refcount--; } - camel_certdb_unlock (certdb, CCD_REF_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_REF_LOCK); } static gboolean @@ -565,7 +565,7 @@ camel_certdb_clear (CamelCertDB *certdb) g_return_if_fail (CAMEL_IS_CERTDB (certdb)); - camel_certdb_lock (certdb, CCD_DB_LOCK); + camel_certdb_lock (certdb, CAMEL_CERTDB_DB_LOCK); g_hash_table_foreach_remove (certdb->cert_hash, cert_remove, NULL); for (i = 0; i < certdb->certs->len; i++) { @@ -577,7 +577,7 @@ camel_certdb_clear (CamelCertDB *certdb) g_ptr_array_set_size (certdb->certs, 0); certdb->flags |= CAMEL_CERTDB_DIRTY; - camel_certdb_unlock (certdb, CCD_DB_LOCK); + camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK); } static const gchar * @@ -694,16 +694,16 @@ camel_certdb_lock (CamelCertDB *certdb, CamelCertDBLock lock) g_return_if_fail (certdb->priv != NULL); switch (lock) { - case CCD_DB_LOCK: + case CAMEL_CERTDB_DB_LOCK: g_mutex_lock (certdb->priv->db_lock); break; - case CCD_IO_LOCK: + case CAMEL_CERTDB_IO_LOCK: g_mutex_lock (certdb->priv->io_lock); break; - case CCD_ALLOC_LOCK: + case CAMEL_CERTDB_ALLOC_LOCK: g_mutex_lock (certdb->priv->alloc_lock); break; - case CCD_REF_LOCK: + case CAMEL_CERTDB_REF_LOCK: g_mutex_lock (certdb->priv->ref_lock); break; default: @@ -728,16 +728,16 @@ camel_certdb_unlock (CamelCertDB *certdb, CamelCertDBLock lock) g_return_if_fail (certdb->priv != NULL); switch (lock) { - case CCD_DB_LOCK: + case CAMEL_CERTDB_DB_LOCK: g_mutex_unlock (certdb->priv->db_lock); break; - case CCD_IO_LOCK: + case CAMEL_CERTDB_IO_LOCK: g_mutex_unlock (certdb->priv->io_lock); break; - case CCD_ALLOC_LOCK: + case CAMEL_CERTDB_ALLOC_LOCK: g_mutex_unlock (certdb->priv->alloc_lock); break; - case CCD_REF_LOCK: + case CAMEL_CERTDB_REF_LOCK: g_mutex_unlock (certdb->priv->ref_lock); break; default: diff --git a/camel/camel-certdb.h b/camel/camel-certdb.h index 4f3c0ee..3c459c2 100644 --- a/camel/camel-certdb.h +++ b/camel/camel-certdb.h @@ -92,10 +92,10 @@ typedef struct { * Since: 3.0 **/ typedef enum { - CCD_DB_LOCK, - CCD_IO_LOCK, - CCD_ALLOC_LOCK, - CCD_REF_LOCK + CAMEL_CERTDB_DB_LOCK, + CAMEL_CERTDB_IO_LOCK, + CAMEL_CERTDB_ALLOC_LOCK, + CAMEL_CERTDB_REF_LOCK } CamelCertDBLock; struct _CamelCertDB { diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c index 2fb2f2e..699db1e 100644 --- a/camel/camel-data-wrapper.c +++ b/camel/camel-data-wrapper.c @@ -84,15 +84,15 @@ data_wrapper_write_to_stream (CamelDataWrapper *data_wrapper, return -1; } - camel_data_wrapper_lock (data_wrapper, CDW_STREAM_LOCK); + camel_data_wrapper_lock (data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK); if (camel_stream_reset (data_wrapper->stream) == -1) { - camel_data_wrapper_unlock (data_wrapper, CDW_STREAM_LOCK); + camel_data_wrapper_unlock (data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK); return -1; } ret = camel_stream_write_to_stream (data_wrapper->stream, stream); - camel_data_wrapper_unlock (data_wrapper, CDW_STREAM_LOCK); + camel_data_wrapper_unlock (data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK); return ret; } @@ -440,7 +440,7 @@ camel_data_wrapper_lock (CamelDataWrapper *data_wrapper, g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper)); switch (lock) { - case CDW_STREAM_LOCK: + case CAMEL_DATA_WRAPPER_STREAM_LOCK: g_static_mutex_lock (&data_wrapper->priv->stream_lock); break; default: @@ -465,7 +465,7 @@ camel_data_wrapper_unlock (CamelDataWrapper *data_wrapper, g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper)); switch (lock) { - case CDW_STREAM_LOCK: + case CAMEL_DATA_WRAPPER_STREAM_LOCK: g_static_mutex_unlock (&data_wrapper->priv->stream_lock); break; default: diff --git a/camel/camel-data-wrapper.h b/camel/camel-data-wrapper.h index 9924b29..bd4b15b 100644 --- a/camel/camel-data-wrapper.h +++ b/camel/camel-data-wrapper.h @@ -65,7 +65,7 @@ typedef struct _CamelDataWrapperPrivate CamelDataWrapperPrivate; * Since: 3.0 **/ typedef enum { - CDW_STREAM_LOCK + CAMEL_DATA_WRAPPER_STREAM_LOCK } CamelDataWrapperLock; struct _CamelDataWrapper { diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 5a60dbc..9755388 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -1009,7 +1009,7 @@ camel_folder_summary_new (struct _CamelFolder *folder) void camel_folder_summary_set_filename(CamelFolderSummary *s, const gchar *name) { - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_free(s->summary_path); s->summary_path = g_strdup(name); @@ -1017,7 +1017,7 @@ camel_folder_summary_set_filename(CamelFolderSummary *s, const gchar *name) g_free(s->meta_summary->path); s->meta_summary->path = g_strconcat(name, "-meta", NULL); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } /** @@ -1093,8 +1093,8 @@ camel_folder_summary_index (CamelFolderSummary *s, gint i) { CamelMessageInfo *info = NULL; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); - camel_folder_summary_lock (s, CFS_REF_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); if (i < s->uids->len) { gchar *uid; @@ -1103,14 +1103,14 @@ camel_folder_summary_index (CamelFolderSummary *s, gint i) /* FIXME: Get exception from caller and pass it on below */ - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return camel_folder_summary_uid (s, uid); } - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return info; } @@ -1136,12 +1136,12 @@ gchar * camel_folder_summary_uid_from_index (CamelFolderSummary *s, gint i) { gchar *uid=NULL; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (iuids->len) uid = g_strdup (g_ptr_array_index(s->uids, i)); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return uid; @@ -1165,16 +1165,16 @@ camel_folder_summary_check_uid (CamelFolderSummary *s, const gchar *uid) gboolean ret = FALSE; gint i; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); for (i=0; iuids->len; i++) { if (strcmp(s->uids->pdata[i], uid) == 0) { - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return TRUE; } } - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return ret; } @@ -1196,13 +1196,13 @@ camel_folder_summary_array(CamelFolderSummary *s) GPtrArray *res = g_ptr_array_new(); gint i; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_ptr_array_set_size(res, s->uids->len); for (i=0;iuids->len;i++) res->pdata[i] = (gpointer) camel_pstring_strdup ((gchar *)g_ptr_array_index(s->uids, i)); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return res; } @@ -1226,12 +1226,12 @@ camel_folder_summary_get_hashtable(CamelFolderSummary *s) GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal); gint i; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); for (i=0;iuids->len;i++) g_hash_table_insert (hash, (gpointer)camel_pstring_strdup ((gchar *)g_ptr_array_index(s->uids, i)), GINT_TO_POINTER(1)); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return hash; } @@ -1274,7 +1274,7 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid) CamelMessageInfo *info; gint ret; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); info = g_hash_table_lookup (s->loaded_infos, uid); @@ -1300,7 +1300,7 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid) cdb, folder_name, uid, &data, camel_read_mir_callback, &ex); if (ret != 0) { - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (camel_exception_is_set (&ex)) g_warning ("%s: Failed read '%s' in '%s' from db: %s (0x%x)", G_STRFUNC, uid, folder_name, camel_exception_get_description (&ex), camel_exception_get_id (&ex)); camel_exception_clear (&ex); @@ -1326,7 +1326,7 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid) if (info) camel_message_info_ref (info); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return info; } @@ -1374,11 +1374,11 @@ camel_folder_summary_next_uid(CamelFolderSummary *s) { guint32 uid; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); uid = s->nextuid++; - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); /* FIXME: sync this to disk */ /* summary_header_save(s);*/ @@ -1398,11 +1398,11 @@ void camel_folder_summary_set_uid(CamelFolderSummary *s, guint32 uid) { /* TODO: sync to disk? */ - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); s->nextuid = MAX(s->nextuid, uid); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } /** @@ -1511,9 +1511,9 @@ camel_folder_summary_get_changed (CamelFolderSummary *s) * We need to have collate or something to get the modified ones * from DB and merge */ - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_hash_table_foreach (s->loaded_infos, (GHFunc) append_changed_uids, res); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return res; } @@ -1530,9 +1530,9 @@ cfs_count_dirty (CamelFolderSummary *s) { gint count = 0; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_hash_table_foreach (s->loaded_infos, (GHFunc) count_changed_uids, &count); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return count; } @@ -1567,11 +1567,11 @@ remove_cache (CamelSession *session, CamelSessionThreadMsg *msg) return; /* FIXME[disk-summary] hack. fix it */ - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); - camel_folder_summary_lock (s, CFS_REF_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); g_hash_table_foreach_remove (s->loaded_infos, (GHRFunc) remove_item, &to_free_list); - camel_folder_summary_unlock (s, CFS_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); /* Deferred freeing as _free function will try to remove entries from the hash_table in foreach_remove otherwise */ @@ -1580,7 +1580,7 @@ remove_cache (CamelSession *session, CamelSessionThreadMsg *msg) g_slist_free (to_free_list); dd(printf(" done .. now %d\n", g_hash_table_size (s->loaded_infos))); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); s->cache_load_time = time(NULL); } @@ -1728,20 +1728,20 @@ preview_update_exec (CamelSession *session, CamelSessionThreadMsg *msg) g_hash_table_destroy (preview_data); } - camel_folder_summary_lock (m->folder->summary, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (m->folder->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_hash_table_foreach (m->folder->summary->loaded_infos, (GHFunc)pick_uids, uids_uncached); - camel_folder_summary_unlock (m->folder->summary, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (m->folder->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); for (i=0; i < uids_uncached->len; i++) { g_hash_table_remove (hash, uids_uncached->pdata[i]); camel_pstring_free (uids_uncached->pdata[i]); /* unref the hash table key */ } - camel_folder_lock (m->folder, CF_REC_LOCK); + camel_folder_lock (m->folder, CAMEL_FOLDER_REC_LOCK); camel_db_begin_transaction (parent_store->cdb_w, NULL); g_hash_table_foreach (hash, (GHFunc)msg_update_preview, m->folder); camel_db_end_transaction (parent_store->cdb_w, NULL); - camel_folder_unlock (m->folder, CF_REC_LOCK); + camel_folder_unlock (m->folder, CAMEL_FOLDER_REC_LOCK); camel_folder_free_uids(m->folder, uids_uncached); camel_folder_summary_free_hashtable (hash); } @@ -1804,9 +1804,9 @@ cfs_reload_from_db (CamelFolderSummary *s, CamelException *ex) void camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info) { - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_hash_table_insert (CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s)->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } /** @@ -1979,14 +1979,14 @@ camel_read_mir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name) mir = g_new0 (CamelMIRecord , 1); mir_from_cols (mir, s, ncol, cols, name); - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (g_hash_table_lookup (s->loaded_infos, mir->uid)) { /* Unlock and better return*/ - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_db_camel_mir_free (mir); return ret; } - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_from_db (s, mir); @@ -2052,7 +2052,7 @@ camel_folder_summary_load(CamelFolderSummary *s) if (in == NULL) return -1; - camel_folder_summary_lock (s, CFS_IO_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_load (s, in) == -1) goto error; @@ -2076,7 +2076,7 @@ camel_folder_summary_load(CamelFolderSummary *s) camel_folder_summary_add (s, mi); } - camel_folder_summary_unlock (s, CFS_IO_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); if (fclose (in) != 0) return -1; @@ -2089,7 +2089,7 @@ error: if (errno != EINVAL) g_warning ("Cannot load summary file: '%s': %s", s->summary_path, g_strerror (errno)); - camel_folder_summary_unlock (s, CFS_IO_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); fclose (in); s->flags |= ~CAMEL_SUMMARY_DIRTY; #endif @@ -2340,10 +2340,10 @@ save_message_infos_to_db (CamelFolderSummary *s, if (camel_db_prepare_message_info_table (cdb, full_name, ex) != 0) return -1; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); /* Push MessageInfo-es */ g_hash_table_foreach (s->loaded_infos, save_to_db_cb, &args); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); /* FIXME[disk-summary] make sure we free the message infos that are loaded * are freed if not used anymore or should we leave that to the timer? */ @@ -2383,10 +2383,10 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s, d(printf ("\ncamel_folder_summary_save_to_db called \n")); if (CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s)->need_preview && g_hash_table_size(CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s)->preview_updates)) { camel_db_begin_transaction (parent_store->cdb_w, NULL); - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_hash_table_foreach (CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s)->preview_updates, (GHFunc)msg_save_preview, s->folder); g_hash_table_remove_all (CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s)->preview_updates); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_db_end_transaction (parent_store->cdb_w, NULL); } @@ -2560,7 +2560,7 @@ camel_folder_summary_save(CamelFolderSummary *s) io(printf("saving header\n")); - camel_folder_summary_lock (s, CFS_IO_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_save (s, out) == -1) goto exception; @@ -2596,7 +2596,7 @@ camel_folder_summary_save(CamelFolderSummary *s) fclose (out); fclose (out_meta); - camel_folder_summary_unlock (s, CFS_IO_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); #ifdef G_OS_WIN32 g_unlink(s->summary_path); @@ -2625,7 +2625,7 @@ exception: fclose (out); fclose (out_meta); - camel_folder_summary_unlock (s, CFS_IO_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); g_unlink (path); g_unlink (path_meta); @@ -2703,12 +2703,12 @@ camel_folder_summary_header_load(CamelFolderSummary *s) return -1; } - camel_folder_summary_lock (s, CFS_IO_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); ret = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_load (s, in); ret = summary_meta_header_load(s, in_meta); - camel_folder_summary_unlock (s, CFS_IO_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_IO_LOCK); fclose(in); fclose(in_meta); @@ -2730,10 +2730,10 @@ summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info) uid = info->uid = (gchar *)camel_pstring_add (camel_folder_summary_next_uid_string(s), TRUE); } - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); while ((mi = g_hash_table_lookup(s->loaded_infos, uid))) { - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (mi == info) return 0; @@ -2744,10 +2744,10 @@ summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info) uid = info->uid = camel_pstring_add (camel_folder_summary_next_uid_string(s), TRUE); camel_message_info_set_flags(info, CAMEL_MESSAGE_FOLDER_FLAGGED, CAMEL_MESSAGE_FOLDER_FLAGGED); - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return 1; } @@ -2774,7 +2774,7 @@ camel_folder_summary_add (CamelFolderSummary *s, CamelMessageInfo *info) if (summary_assign_uid(s, info) == 0) return; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); /* Summary always holds a ref for the loaded infos */ /* camel_message_info_ref(info); FIXME: Check how things are loaded. */ @@ -2786,7 +2786,7 @@ camel_folder_summary_add (CamelFolderSummary *s, CamelMessageInfo *info) g_hash_table_insert (s->loaded_infos, (gpointer) camel_message_info_uid (info), info); s->flags |= CAMEL_SUMMARY_DIRTY; - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } /** @@ -2800,7 +2800,7 @@ camel_folder_summary_insert (CamelFolderSummary *s, CamelMessageInfo *info, gboo if (info == NULL) return; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); /* Summary always holds a ref for the loaded infos */ /* camel_message_info_ref(info); FIXME: Check how things are loaded. */ @@ -2817,7 +2817,7 @@ camel_folder_summary_insert (CamelFolderSummary *s, CamelMessageInfo *info, gboo if (!load) s->flags |= CAMEL_SUMMARY_DIRTY; - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } static void @@ -2999,7 +2999,7 @@ camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser if (p->index) summary_assign_uid(s, info); - camel_folder_summary_lock (s, CFS_FILTER_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_FILTER_LOCK); if (p->index) { if (p->filter_index == NULL) @@ -3019,7 +3019,7 @@ camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser CAMEL_MIME_FILTER_INDEX (p->filter_index), NULL); } - camel_folder_summary_unlock (s, CFS_FILTER_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_FILTER_LOCK); ((CamelMessageInfoBase *)info)->size = camel_mime_parser_tell(mp) - start; } @@ -3051,7 +3051,7 @@ camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessa if (p->index) summary_assign_uid(s, info); - camel_folder_summary_lock (s, CFS_FILTER_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_FILTER_LOCK); if (p->index) { if (p->filter_index == NULL) @@ -3078,7 +3078,7 @@ camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessa CAMEL_MIME_FILTER_INDEX (p->filter_index), NULL); } - camel_folder_summary_unlock (s, CFS_FILTER_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_FILTER_LOCK); return info; } @@ -3114,9 +3114,9 @@ camel_folder_summary_content_info_free(CamelFolderSummary *s, CamelMessageConten void camel_folder_summary_touch(CamelFolderSummary *s) { - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); s->flags |= CAMEL_SUMMARY_DIRTY; - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } /** @@ -3131,9 +3131,9 @@ camel_folder_summary_clear(CamelFolderSummary *s) d(printf ("\ncamel_folder_summary_clearcalled \n")); s->flags &= ~CAMEL_SUMMARY_DIRTY; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (camel_folder_summary_count(s) == 0) { - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return; } @@ -3145,7 +3145,7 @@ camel_folder_summary_clear(CamelFolderSummary *s) g_hash_table_destroy(s->loaded_infos); s->loaded_infos = g_hash_table_new(g_str_hash, g_str_equal); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } /** @@ -3171,9 +3171,9 @@ camel_folder_summary_clear_db (CamelFolderSummary *s) parent_store = camel_folder_get_parent_store (s->folder); cdb = parent_store->cdb_w; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (camel_folder_summary_count(s) == 0) { - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return; } @@ -3185,7 +3185,7 @@ camel_folder_summary_clear_db (CamelFolderSummary *s) g_hash_table_destroy(s->loaded_infos); s->loaded_infos = g_hash_table_new(g_str_hash, g_str_equal); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_db_clear_folder_summary (cdb, folder_name, NULL); } @@ -3228,7 +3228,7 @@ camel_folder_summary_remove (CamelFolderSummary *s, CamelMessageInfo *info) gboolean found; gint ret; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); found = g_hash_table_lookup (s->loaded_infos, camel_message_info_uid (info)) != NULL; g_hash_table_remove (s->loaded_infos, camel_message_info_uid(info)); @@ -3236,7 +3236,7 @@ camel_folder_summary_remove (CamelFolderSummary *s, CamelMessageInfo *info) s->flags |= CAMEL_SUMMARY_DIRTY; s->meta_summary->msg_expunged = TRUE; - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); full_name = camel_folder_get_full_name (s->folder); parent_store = camel_folder_get_parent_store (s->folder); @@ -3261,13 +3261,13 @@ camel_folder_summary_remove_uid(CamelFolderSummary *s, const gchar *uid) CamelMessageInfo *oldinfo; gchar *olduid; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); - camel_folder_summary_lock (s, CFS_REF_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); if (g_hash_table_lookup_extended(s->loaded_infos, uid, (gpointer)&olduid, (gpointer)&oldinfo)) { /* make sure it doesn't vanish while we're removing it */ camel_message_info_ref (oldinfo); - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_folder_summary_remove(s, oldinfo); camel_message_info_free(oldinfo); } else { @@ -3277,8 +3277,8 @@ camel_folder_summary_remove_uid(CamelFolderSummary *s, const gchar *uid) gint ret; /* Info isn't loaded into the memory. We must just remove the UID*/ ret = summary_remove_uid (s, uid); - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); full_name = camel_folder_get_full_name (s->folder); parent_store = camel_folder_get_parent_store (s->folder); @@ -3303,25 +3303,25 @@ camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const gchar *uid) CamelMessageInfo *oldinfo; gchar *olduid; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); - camel_folder_summary_lock (s, CFS_REF_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); if (g_hash_table_lookup_extended(s->loaded_infos, uid, (gpointer)&olduid, (gpointer)&oldinfo)) { /* make sure it doesn't vanish while we're removing it */ camel_message_info_ref (oldinfo); - camel_folder_summary_unlock (s, CFS_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); g_hash_table_remove (s->loaded_infos, olduid); summary_remove_uid (s, olduid); s->flags |= CAMEL_SUMMARY_DIRTY; s->meta_summary->msg_expunged = TRUE; camel_message_info_free(oldinfo); camel_message_info_free(oldinfo); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } else { gchar *tmpid = g_strdup (uid); /* Info isn't loaded into the memory. We must just remove the UID*/ summary_remove_uid (s, uid); - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); g_free (tmpid); } } @@ -3338,23 +3338,23 @@ camel_folder_summary_remove_index_fast (CamelFolderSummary *s, gint index) CamelMessageInfo *oldinfo; gchar *olduid; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); - camel_folder_summary_lock (s, CFS_REF_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); if (g_hash_table_lookup_extended(s->loaded_infos, uid, (gpointer)&olduid, (gpointer)&oldinfo)) { /* make sure it doesn't vanish while we're removing it */ g_hash_table_remove (s->loaded_infos, uid); camel_pstring_free (uid); g_ptr_array_remove_index(s->uids, index); - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_message_info_free(oldinfo); } else { /* Info isn't loaded into the memory. We must just remove the UID*/ g_ptr_array_remove_index(s->uids, index); camel_pstring_free (uid); - camel_folder_summary_unlock (s, CFS_REF_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } } @@ -3388,7 +3388,7 @@ camel_folder_summary_remove_range (CamelFolderSummary *s, gint start, gint end) if (end < start) return; - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (start < s->uids->len) { @@ -3433,11 +3433,11 @@ camel_folder_summary_remove_range (CamelFolderSummary *s, gint start, gint end) s->flags |= CAMEL_SUMMARY_DIRTY; - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_exception_clear (&ex); } else { - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); } } @@ -3835,9 +3835,9 @@ camel_folder_summary_content_info_new(CamelFolderSummary *s) class = CAMEL_FOLDER_SUMMARY_GET_CLASS (s); - camel_folder_summary_lock (s, CFS_ALLOC_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_ALLOC_LOCK); ci = g_slice_alloc0 (class->content_info_size); - camel_folder_summary_unlock (s, CFS_ALLOC_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_ALLOC_LOCK); return ci; } @@ -4905,10 +4905,10 @@ camel_message_info_new (CamelFolderSummary *s) CamelMessageInfo *info; if (s) { - camel_folder_summary_lock (s, CFS_ALLOC_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_ALLOC_LOCK); class = CAMEL_FOLDER_SUMMARY_GET_CLASS (s); info = g_slice_alloc0 (class->message_info_size); - camel_folder_summary_unlock (s, CFS_ALLOC_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_ALLOC_LOCK); } else { info = g_slice_alloc0 (sizeof(CamelMessageInfoBase)); } @@ -4934,10 +4934,10 @@ camel_message_info_ref(gpointer o) CamelMessageInfo *mi = o; if (mi->summary) { - camel_folder_summary_lock (mi->summary, CFS_REF_LOCK); + camel_folder_summary_lock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK); g_assert(mi->refcount >= 1); mi->refcount++; - camel_folder_summary_unlock (mi->summary, CFS_REF_LOCK); + camel_folder_summary_unlock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK); } else { GLOBAL_INFO_LOCK(info); g_assert(mi->refcount >= 1); @@ -4981,16 +4981,16 @@ camel_message_info_free(gpointer o) g_return_if_fail(mi != NULL); if (mi->summary) { - camel_folder_summary_lock (mi->summary, CFS_REF_LOCK); + camel_folder_summary_lock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK); if (mi->refcount >= 1) mi->refcount--; if (mi->refcount > 0) { - camel_folder_summary_unlock (mi->summary, CFS_REF_LOCK); + camel_folder_summary_unlock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK); return; } - camel_folder_summary_unlock (mi->summary, CFS_REF_LOCK); + camel_folder_summary_unlock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK); /* FIXME: this is kinda busted, should really be handled by message info free */ if (mi->summary->build_content @@ -5334,19 +5334,19 @@ camel_folder_summary_lock (CamelFolderSummary *summary, g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary)); switch (lock) { - case CFS_SUMMARY_LOCK: + case CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK: g_static_rec_mutex_lock (&summary->priv->summary_lock); break; - case CFS_IO_LOCK: + case CAMEL_FOLDER_SUMMARY_IO_LOCK: g_static_rec_mutex_lock (&summary->priv->io_lock); break; - case CFS_FILTER_LOCK: + case CAMEL_FOLDER_SUMMARY_FILTER_LOCK: g_static_rec_mutex_lock (&summary->priv->filter_lock); break; - case CFS_ALLOC_LOCK: + case CAMEL_FOLDER_SUMMARY_ALLOC_LOCK: g_static_rec_mutex_lock (&summary->priv->alloc_lock); break; - case CFS_REF_LOCK: + case CAMEL_FOLDER_SUMMARY_REF_LOCK: g_static_rec_mutex_lock (&summary->priv->ref_lock); break; default: @@ -5370,19 +5370,19 @@ camel_folder_summary_unlock (CamelFolderSummary *summary, g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary)); switch (lock) { - case CFS_SUMMARY_LOCK: + case CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK: g_static_rec_mutex_unlock (&summary->priv->summary_lock); break; - case CFS_IO_LOCK: + case CAMEL_FOLDER_SUMMARY_IO_LOCK: g_static_rec_mutex_unlock (&summary->priv->io_lock); break; - case CFS_FILTER_LOCK: + case CAMEL_FOLDER_SUMMARY_FILTER_LOCK: g_static_rec_mutex_unlock (&summary->priv->filter_lock); break; - case CFS_ALLOC_LOCK: + case CAMEL_FOLDER_SUMMARY_ALLOC_LOCK: g_static_rec_mutex_unlock (&summary->priv->alloc_lock); break; - case CFS_REF_LOCK: + case CAMEL_FOLDER_SUMMARY_REF_LOCK: g_static_rec_mutex_unlock (&summary->priv->ref_lock); break; default: diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h index 48bfe53..1c8d2ed 100644 --- a/camel/camel-folder-summary.h +++ b/camel/camel-folder-summary.h @@ -230,11 +230,11 @@ typedef enum _CamelFolderSummaryFlags { } CamelFolderSummaryFlags; typedef enum _CamelFolderSummaryLock { - CFS_SUMMARY_LOCK, - CFS_IO_LOCK, - CFS_FILTER_LOCK, - CFS_ALLOC_LOCK, - CFS_REF_LOCK + CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK, + CAMEL_FOLDER_SUMMARY_IO_LOCK, + CAMEL_FOLDER_SUMMARY_FILTER_LOCK, + CAMEL_FOLDER_SUMMARY_ALLOC_LOCK, + CAMEL_FOLDER_SUMMARY_REF_LOCK } CamelFolderSummaryLock; struct _CamelFolderSummary { diff --git a/camel/camel-folder.c b/camel/camel-folder.c index c0f6070..e191c40 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -579,12 +579,12 @@ folder_freeze (CamelFolder *folder) { g_return_if_fail (folder->priv->frozen >= 0); - camel_folder_lock (folder, CF_CHANGE_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK); folder->priv->frozen++; d (printf ("freeze (%p '%s') = %d\n", folder, folder->full_name, folder->priv->frozen)); - camel_folder_unlock (folder, CF_CHANGE_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK); } static void @@ -594,7 +594,7 @@ folder_thaw (CamelFolder * folder) g_return_if_fail (folder->priv->frozen > 0); - camel_folder_lock (folder, CF_CHANGE_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK); folder->priv->frozen--; @@ -606,7 +606,7 @@ folder_thaw (CamelFolder * folder) folder->priv->changed_frozen = camel_folder_change_info_new (); } - camel_folder_unlock (folder, CF_CHANGE_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK); if (info) { camel_object_trigger_event (folder, "folder_changed", info); @@ -816,12 +816,12 @@ camel_folder_sync (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->sync != NULL, FALSE); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED)) success = class->sync (folder, expunge, ex); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); return success; } @@ -847,11 +847,11 @@ camel_folder_refresh_info (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->refresh_info != NULL, FALSE); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); success = class->refresh_info (folder, ex); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); return success; } @@ -1005,12 +1005,12 @@ camel_folder_expunge (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->expunge != NULL, FALSE); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED)) success = class->expunge (folder, ex); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); return success; } @@ -1100,12 +1100,12 @@ camel_folder_append_message (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->append_message != NULL, FALSE); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); success = class->append_message ( folder, message, info, appended_uid, ex); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); return success; } @@ -1436,11 +1436,11 @@ camel_folder_get_message (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->get_message != NULL, NULL); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); ret = class->get_message (folder, uid, ex); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); if (ret && camel_debug_start (":folder")) { printf ("CamelFolder:get_message ('%s', '%s') =\n", @@ -1479,7 +1479,7 @@ camel_folder_sync_message (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->get_message != NULL, FALSE); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); /* Use the sync_message method if the class implements it. */ if (class->sync_message != NULL) @@ -1494,7 +1494,7 @@ camel_folder_sync_message (CamelFolder *folder, } } - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); return success; } @@ -1713,7 +1713,7 @@ camel_folder_search_by_expression (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->search_by_expression != NULL, NULL); - /* NOTE: that it is upto the callee to CF_REC_LOCK */ + /* NOTE: that it is upto the callee to CAMEL_FOLDER_REC_LOCK */ return class->search_by_expression (folder, expression, ex); } @@ -1743,7 +1743,7 @@ camel_folder_count_by_expression (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->count_by_expression != NULL, 0); - /* NOTE: that it is upto the callee to CF_REC_LOCK */ + /* NOTE: that it is upto the callee to CAMEL_FOLDER_REC_LOCK */ return class->count_by_expression (folder, expression, ex); } @@ -1774,7 +1774,7 @@ camel_folder_search_by_uids (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_val_if_fail (class->search_by_uids != NULL, NULL); - /* NOTE: that it is upto the callee to CF_REC_LOCK */ + /* NOTE: that it is upto the callee to CAMEL_FOLDER_REC_LOCK */ return class->search_by_uids (folder, expr, uids, ex); } @@ -1799,7 +1799,7 @@ camel_folder_search_free (CamelFolder *folder, class = CAMEL_FOLDER_GET_CLASS (folder); g_return_if_fail (class->search_free != NULL); - /* NOTE: upto the callee to CF_REC_LOCK */ + /* NOTE: upto the callee to CAMEL_FOLDER_REC_LOCK */ class->search_free (folder, result); } @@ -1876,9 +1876,9 @@ camel_folder_delete (CamelFolder *folder) class = CAMEL_FOLDER_GET_CLASS (folder); g_return_if_fail (class->delete != NULL); - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); if (folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) { - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); return; } @@ -1886,7 +1886,7 @@ camel_folder_delete (CamelFolder *folder) class->delete (folder); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); /* Delete the references of the folder from the DB.*/ full_name = camel_folder_get_full_name (folder); @@ -2295,14 +2295,14 @@ folder_changed (CamelObject *obj, gpointer event_data) return TRUE; } - camel_folder_lock (folder, CF_CHANGE_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK); if (folder->priv->frozen) { camel_folder_change_info_cat (folder->priv->changed_frozen, changed); - camel_folder_unlock (folder, CF_CHANGE_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK); return FALSE; } - camel_folder_unlock (folder, CF_CHANGE_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK); if (session->junk_plugin && changed->uid_changed->len) { guint32 flags; @@ -2353,9 +2353,9 @@ folder_changed (CamelObject *obj, gpointer event_data) camel_folder_freeze (folder); /* Copy changes back to changed_frozen list to retain * them while we are filtering */ - camel_folder_lock (folder, CF_CHANGE_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK); camel_folder_change_info_cat (folder->priv->changed_frozen, changed); - camel_folder_unlock (folder, CF_CHANGE_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK); msg->driver = driver; camel_exception_init (&msg->ex); camel_session_thread_queue (session, &msg->msg, 0); @@ -2878,10 +2878,10 @@ camel_folder_lock (CamelFolder *folder, g_return_if_fail (CAMEL_IS_FOLDER (folder)); switch (lock) { - case CF_CHANGE_LOCK: + case CAMEL_FOLDER_CHANGE_LOCK: g_static_mutex_lock (&folder->priv->change_lock); break; - case CF_REC_LOCK: + case CAMEL_FOLDER_REC_LOCK: if (folder->priv->skip_folder_lock == FALSE) g_static_rec_mutex_lock (&folder->priv->lock); break; @@ -2906,10 +2906,10 @@ camel_folder_unlock (CamelFolder *folder, g_return_if_fail (CAMEL_IS_FOLDER (folder)); switch (lock) { - case CF_CHANGE_LOCK: + case CAMEL_FOLDER_CHANGE_LOCK: g_static_mutex_unlock (&folder->priv->change_lock); break; - case CF_REC_LOCK: + case CAMEL_FOLDER_REC_LOCK: if (folder->priv->skip_folder_lock == FALSE) g_static_rec_mutex_unlock (&folder->priv->lock); break; diff --git a/camel/camel-folder.h b/camel/camel-folder.h index 3f0f377..2f188d8 100644 --- a/camel/camel-folder.h +++ b/camel/camel-folder.h @@ -67,8 +67,8 @@ typedef struct _CamelFolderPrivate CamelFolderPrivate; * Since: 3.0 **/ typedef enum { - CF_CHANGE_LOCK, - CF_REC_LOCK + CAMEL_FOLDER_CHANGE_LOCK, + CAMEL_FOLDER_REC_LOCK } CamelFolderLock; struct _CamelFolderChangeInfo { diff --git a/camel/camel-service.c b/camel/camel-service.c index bab7359..b92502b 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -294,16 +294,16 @@ camel_service_connect (CamelService *service, class = CAMEL_SERVICE_GET_CLASS (service); g_return_val_if_fail (class->connect != NULL, FALSE); - camel_service_lock (service, CS_REC_CONNECT_LOCK); + camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (service->status == CAMEL_SERVICE_CONNECTED) { - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } /* Register a separate operation for connecting, so that * the offline code can cancel it. */ - camel_service_lock (service, CS_CONNECT_OP_LOCK); + camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); service->connect_op = camel_operation_registered (); if (!service->connect_op) { service->connect_op = camel_operation_new (NULL, NULL); @@ -311,13 +311,13 @@ camel_service_connect (CamelService *service, unreg = TRUE; } connect_op = service->connect_op; - camel_service_unlock (service, CS_CONNECT_OP_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); service->status = CAMEL_SERVICE_CONNECTING; ret = class->connect (service, ex); service->status = ret ? CAMEL_SERVICE_CONNECTED : CAMEL_SERVICE_DISCONNECTED; - camel_service_lock (service, CS_CONNECT_OP_LOCK); + camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); if (connect_op) { if (unreg && service->connect_op) camel_operation_unregister (connect_op); @@ -325,9 +325,9 @@ camel_service_connect (CamelService *service, camel_operation_unref (connect_op); service->connect_op = NULL; } - camel_service_unlock (service, CS_CONNECT_OP_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); return ret; } @@ -357,33 +357,33 @@ camel_service_disconnect (CamelService *service, class = CAMEL_SERVICE_GET_CLASS (service); g_return_val_if_fail (class->disconnect != NULL, FALSE); - camel_service_lock (service, CS_REC_CONNECT_LOCK); + camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (service->status != CAMEL_SERVICE_DISCONNECTED && service->status != CAMEL_SERVICE_DISCONNECTING) { - camel_service_lock (service, CS_CONNECT_OP_LOCK); + camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); service->connect_op = camel_operation_registered (); if (!service->connect_op) { service->connect_op = camel_operation_new (NULL, NULL); camel_operation_register (service->connect_op); unreg = TRUE; } - camel_service_unlock (service, CS_CONNECT_OP_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); service->status = CAMEL_SERVICE_DISCONNECTING; res = class->disconnect (service, clean, ex); service->status = CAMEL_SERVICE_DISCONNECTED; - camel_service_lock (service, CS_CONNECT_OP_LOCK); + camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); if (unreg) camel_operation_unregister (service->connect_op); camel_operation_unref (service->connect_op); service->connect_op = NULL; - camel_service_unlock (service, CS_CONNECT_OP_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); } - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); service->status = CAMEL_SERVICE_DISCONNECTED; @@ -408,10 +408,10 @@ camel_service_cancel_connect (CamelService *service) class = CAMEL_SERVICE_GET_CLASS (service); g_return_if_fail (class->cancel_connect != NULL); - camel_service_lock (service, CS_CONNECT_OP_LOCK); + camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); if (service->connect_op) class->cancel_connect (service); - camel_service_unlock (service, CS_CONNECT_OP_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK); } /** @@ -543,9 +543,9 @@ camel_service_query_auth_types (CamelService *service, /* Note that we get the connect lock here, which means the * callee must not call the connect functions itself. */ - camel_service_lock (service, CS_REC_CONNECT_LOCK); + camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); ret = class->query_auth_types (service, ex); - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); return ret; } @@ -566,10 +566,10 @@ camel_service_lock (CamelService *service, g_return_if_fail (CAMEL_IS_SERVICE (service)); switch (lock) { - case CS_REC_CONNECT_LOCK: + case CAMEL_SERVICE_REC_CONNECT_LOCK: g_static_rec_mutex_lock (&service->priv->connect_lock); break; - case CS_CONNECT_OP_LOCK: + case CAMEL_SERVICE_CONNECT_OP_LOCK: g_static_mutex_lock (&service->priv->connect_op_lock); break; default: @@ -593,10 +593,10 @@ camel_service_unlock (CamelService *service, g_return_if_fail (CAMEL_IS_SERVICE (service)); switch (lock) { - case CS_REC_CONNECT_LOCK: + case CAMEL_SERVICE_REC_CONNECT_LOCK: g_static_rec_mutex_unlock (&service->priv->connect_lock); break; - case CS_CONNECT_OP_LOCK: + case CAMEL_SERVICE_CONNECT_OP_LOCK: g_static_mutex_unlock (&service->priv->connect_op_lock); break; default: diff --git a/camel/camel-service.h b/camel/camel-service.h index 6817055..7b4e948 100644 --- a/camel/camel-service.h +++ b/camel/camel-service.h @@ -74,8 +74,8 @@ typedef enum { * Since: 3.0 **/ typedef enum { - CS_REC_CONNECT_LOCK, - CS_CONNECT_OP_LOCK + CAMEL_SERVICE_REC_CONNECT_LOCK, + CAMEL_SERVICE_CONNECT_OP_LOCK } CamelServiceLock; struct _CamelService { diff --git a/camel/camel-session.c b/camel/camel-session.c index e7bc424..1f9a8da 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -206,10 +206,10 @@ session_thread_msg_new (CamelSession *session, m->session = g_object_ref (session); m->op = camel_operation_new(cs_thread_status, m); camel_exception_init(&m->ex); - camel_session_lock (session, CS_THREAD_LOCK); + camel_session_lock (session, CAMEL_SESSION_THREAD_LOCK); m->id = session->priv->thread_id++; g_hash_table_insert(session->priv->thread_active, GINT_TO_POINTER(m->id), m); - camel_session_unlock (session, CS_THREAD_LOCK); + camel_session_unlock (session, CAMEL_SESSION_THREAD_LOCK); return m; } @@ -223,9 +223,9 @@ session_thread_msg_free (CamelSession *session, d(printf("free message %p session %p\n", msg, session)); - camel_session_lock (session, CS_THREAD_LOCK); + camel_session_lock (session, CAMEL_SESSION_THREAD_LOCK); g_hash_table_remove(session->priv->thread_active, GINT_TO_POINTER(msg->id)); - camel_session_unlock (session, CS_THREAD_LOCK); + camel_session_unlock (session, CAMEL_SESSION_THREAD_LOCK); d(printf("free msg, ops->free = %p\n", msg->ops->free)); @@ -261,7 +261,7 @@ session_thread_queue (CamelSession *session, GThreadPool *thread_pool; gint id; - camel_session_lock (session, CS_THREAD_LOCK); + camel_session_lock (session, CAMEL_SESSION_THREAD_LOCK); thread_pool = session->priv->thread_pool; if (thread_pool == NULL) { thread_pool = g_thread_pool_new ( @@ -269,7 +269,7 @@ session_thread_queue (CamelSession *session, session, 1, FALSE, NULL); session->priv->thread_pool = thread_pool; } - camel_session_unlock (session, CS_THREAD_LOCK); + camel_session_unlock (session, CAMEL_SESSION_THREAD_LOCK); id = msg->id; g_thread_pool_push(thread_pool, msg, NULL); @@ -285,9 +285,9 @@ session_thread_wait (CamelSession *session, /* we just busy wait, only other alternative is to setup a reply port? */ do { - camel_session_lock (session, CS_THREAD_LOCK); + camel_session_lock (session, CAMEL_SESSION_THREAD_LOCK); wait = g_hash_table_lookup(session->priv->thread_active, GINT_TO_POINTER(id)) != NULL; - camel_session_unlock (session, CS_THREAD_LOCK); + camel_session_unlock (session, CAMEL_SESSION_THREAD_LOCK); if (wait) { g_usleep(20000); } @@ -389,11 +389,11 @@ camel_session_get_service (CamelSession *session, class = CAMEL_SESSION_GET_CLASS (session); g_return_val_if_fail (class->get_service != NULL, NULL); - camel_session_lock (session, CS_SESSION_LOCK); + camel_session_lock (session, CAMEL_SESSION_SESSION_LOCK); service = class->get_service (session, url_string, type, ex); - camel_session_unlock (session, CS_SESSION_LOCK); + camel_session_unlock (session, CAMEL_SESSION_SESSION_LOCK); return service; } @@ -944,10 +944,10 @@ camel_session_lock (CamelSession *session, g_return_if_fail (CAMEL_IS_SESSION (session)); switch (lock) { - case CS_SESSION_LOCK: + case CAMEL_SESSION_SESSION_LOCK: g_mutex_lock (session->priv->lock); break; - case CS_THREAD_LOCK: + case CAMEL_SESSION_THREAD_LOCK: g_mutex_lock (session->priv->thread_lock); break; default: @@ -971,10 +971,10 @@ camel_session_unlock (CamelSession *session, g_return_if_fail (CAMEL_IS_SESSION (session)); switch (lock) { - case CS_SESSION_LOCK: + case CAMEL_SESSION_SESSION_LOCK: g_mutex_unlock (session->priv->lock); break; - case CS_THREAD_LOCK: + case CAMEL_SESSION_THREAD_LOCK: g_mutex_unlock (session->priv->thread_lock); break; default: diff --git a/camel/camel-session.h b/camel/camel-session.h index 628f647..3c7a12d 100644 --- a/camel/camel-session.h +++ b/camel/camel-session.h @@ -81,8 +81,8 @@ enum { * Since: 3.0 **/ typedef enum { - CS_SESSION_LOCK, - CS_THREAD_LOCK + CAMEL_SESSION_SESSION_LOCK, + CAMEL_SESSION_THREAD_LOCK } CamelSessionLock; struct _CamelSession { diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c index 3e01cad..1890911 100644 --- a/camel/camel-store-summary.c +++ b/camel/camel-store-summary.c @@ -58,7 +58,7 @@ struct _CamelStoreSummaryPrivate { GMutex *summary_lock; /* for the summary hashtable/array */ GMutex *io_lock; /* load/save lock, for access to saved_count, etc */ - GMutex *ref_lock; /* for reffing/unreffing messageinfo's ALWAYS obtain before CSS_SUMMARY_LOCK */ + GMutex *ref_lock; /* for reffing/unreffing messageinfo's ALWAYS obtain before CAMEL_STORE_SUMMARY_SUMMARY_LOCK */ }; G_DEFINE_TYPE (CamelStoreSummary, camel_store_summary, CAMEL_TYPE_OBJECT) @@ -261,7 +261,7 @@ store_summary_store_info_set_string (CamelStoreSummary *summary, switch (type) { case CAMEL_STORE_INFO_PATH: - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_hash_table_remove (summary->folders_path, (gchar *)camel_store_info_path (summary, info)); g_free (info->path); g_free (info->uri); @@ -269,10 +269,10 @@ store_summary_store_info_set_string (CamelStoreSummary *summary, info->path = g_strdup (str); g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info); summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); break; case CAMEL_STORE_INFO_NAME: - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_hash_table_remove (summary->folders_path, (gchar *)camel_store_info_path (summary, info)); p = strrchr (info->path, '/'); if (p) { @@ -288,7 +288,7 @@ store_summary_store_info_set_string (CamelStoreSummary *summary, g_free (info->uri); info->uri = NULL; g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info); - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); break; case CAMEL_STORE_INFO_URI: g_warning ("Cannot set store info uri, aborting"); @@ -365,12 +365,12 @@ camel_store_summary_set_filename (CamelStoreSummary *summary, { g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_free (summary->summary_path); summary->summary_path = g_strdup (name); - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); } /** @@ -386,13 +386,13 @@ camel_store_summary_set_uri_base (CamelStoreSummary *summary, { g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (summary->uri_base) camel_url_free (summary->uri_base); summary->uri_base = camel_url_new_with_base (base, ""); - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); } /** @@ -433,18 +433,18 @@ camel_store_summary_index (CamelStoreSummary *summary, g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL); - camel_store_summary_lock (summary, CSS_REF_LOCK); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (i < summary->folders->len) info = g_ptr_array_index (summary->folders, i); - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (info) info->refcount++; - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); return info; } @@ -469,8 +469,8 @@ camel_store_summary_array (CamelStoreSummary *summary) g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL); - camel_store_summary_lock (summary, CSS_REF_LOCK); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); res = g_ptr_array_new (); g_ptr_array_set_size (res, summary->folders->len); @@ -479,8 +479,8 @@ camel_store_summary_array (CamelStoreSummary *summary) info->refcount++; } - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); return res; } @@ -531,17 +531,17 @@ camel_store_summary_path (CamelStoreSummary *summary, g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL); g_return_val_if_fail (path != NULL, NULL); - camel_store_summary_lock (summary, CSS_REF_LOCK); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); info = g_hash_table_lookup (summary->folders_path, path); - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (info) info->refcount++; - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); return info; } @@ -572,7 +572,7 @@ camel_store_summary_load (CamelStoreSummary *summary) if (in == NULL) return -1; - camel_store_summary_lock (summary, CSS_IO_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); if (class->summary_header_load (summary, in) == -1) goto error; @@ -586,7 +586,7 @@ camel_store_summary_load (CamelStoreSummary *summary) camel_store_summary_add (summary, info); } - camel_store_summary_unlock (summary, CSS_IO_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); if (fclose (in) != 0) return -1; @@ -598,7 +598,7 @@ camel_store_summary_load (CamelStoreSummary *summary) error: i = ferror (in); g_warning ("Cannot load summary file: %s", g_strerror (ferror (in))); - camel_store_summary_unlock (summary, CSS_IO_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); fclose (in); summary->flags |= ~CAMEL_STORE_SUMMARY_DIRTY; errno = i; @@ -655,12 +655,12 @@ camel_store_summary_save (CamelStoreSummary *summary) io (printf ("saving header\n")); - camel_store_summary_lock (summary, CSS_IO_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); if (class->summary_header_save (summary, out) == -1) { i = errno; fclose (out); - camel_store_summary_unlock (summary, CSS_IO_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); errno = i; return -1; } @@ -675,7 +675,7 @@ camel_store_summary_save (CamelStoreSummary *summary) class->store_info_save (summary, out, info); } - camel_store_summary_unlock (summary, CSS_IO_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); if (fflush (out) != 0 || fsync (fileno (out)) == -1) { i = errno; @@ -718,9 +718,9 @@ camel_store_summary_header_load (CamelStoreSummary *summary) if (in == NULL) return -1; - camel_store_summary_lock (summary, CSS_IO_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); ret = class->summary_header_load (summary, in); - camel_store_summary_unlock (summary, CSS_IO_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_IO_LOCK); fclose (in); summary->flags &= ~CAMEL_STORE_SUMMARY_DIRTY; @@ -754,13 +754,13 @@ camel_store_summary_add (CamelStoreSummary *summary, return; } - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_ptr_array_add (summary->folders, info); g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info); summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); } /** @@ -781,7 +781,7 @@ camel_store_summary_add_from_path (CamelStoreSummary *summary, g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL); g_return_val_if_fail (path != NULL, NULL); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); info = g_hash_table_lookup (summary->folders_path, path); if (info != NULL) { @@ -794,7 +794,7 @@ camel_store_summary_add_from_path (CamelStoreSummary *summary, summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; } - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); return info; } @@ -845,15 +845,15 @@ camel_store_summary_info_free (CamelStoreSummary *summary, class = CAMEL_STORE_SUMMARY_GET_CLASS (summary); g_return_if_fail (class->store_info_free != NULL); - camel_store_summary_lock (summary, CSS_REF_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); info->refcount--; if (info->refcount > 0) { - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); return; } - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); class->store_info_free (summary, info); } @@ -872,9 +872,9 @@ camel_store_summary_info_ref (CamelStoreSummary *summary, g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); g_return_if_fail (info != NULL && info->refcount >= 1); - camel_store_summary_lock (summary, CSS_REF_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); info->refcount++; - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); } /** @@ -889,9 +889,9 @@ camel_store_summary_touch (CamelStoreSummary *summary) { g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); } /** @@ -907,9 +907,9 @@ camel_store_summary_clear (CamelStoreSummary *summary) g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (camel_store_summary_count (summary) == 0) { - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); return; } @@ -920,7 +920,7 @@ camel_store_summary_clear (CamelStoreSummary *summary) g_hash_table_destroy (summary->folders_path); summary->folders_path = g_hash_table_new (g_str_hash, g_str_equal); summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); } /** @@ -937,11 +937,11 @@ camel_store_summary_remove (CamelStoreSummary *summary, g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); g_return_if_fail (info != NULL); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_hash_table_remove (summary->folders_path, camel_store_info_path (summary, info)); g_ptr_array_remove (summary->folders, info); summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); camel_store_summary_info_free (summary, info); } @@ -963,18 +963,18 @@ camel_store_summary_remove_path (CamelStoreSummary *summary, g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); g_return_if_fail (path != NULL); - camel_store_summary_lock (summary, CSS_REF_LOCK); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (g_hash_table_lookup_extended (summary->folders_path, path, (gpointer)&oldpath, (gpointer)&oldinfo)) { /* make sure it doesn't vanish while we're removing it */ oldinfo->refcount++; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); camel_store_summary_remove (summary, oldinfo); camel_store_summary_info_free (summary, oldinfo); } else { - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); - camel_store_summary_unlock (summary, CSS_REF_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK); } } @@ -991,7 +991,7 @@ camel_store_summary_remove_index (CamelStoreSummary *summary, { g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); - camel_store_summary_lock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); if (index < summary->folders->len) { CamelStoreInfo *info = summary->folders->pdata[index]; @@ -999,10 +999,10 @@ camel_store_summary_remove_index (CamelStoreSummary *summary, g_ptr_array_remove_index (summary->folders, index); summary->flags |= CAMEL_STORE_SUMMARY_DIRTY; - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); camel_store_summary_info_free (summary, info); } else { - camel_store_summary_unlock (summary, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); } } @@ -1096,13 +1096,13 @@ camel_store_summary_lock (CamelStoreSummary *summary, g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); switch (lock) { - case CSS_SUMMARY_LOCK: + case CAMEL_STORE_SUMMARY_SUMMARY_LOCK: g_mutex_lock (summary->priv->summary_lock); break; - case CSS_IO_LOCK: + case CAMEL_STORE_SUMMARY_IO_LOCK: g_mutex_lock (summary->priv->io_lock); break; - case CSS_REF_LOCK: + case CAMEL_STORE_SUMMARY_REF_LOCK: g_mutex_lock (summary->priv->ref_lock); break; default: @@ -1126,13 +1126,13 @@ camel_store_summary_unlock (CamelStoreSummary *summary, g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary)); switch (lock) { - case CSS_SUMMARY_LOCK: + case CAMEL_STORE_SUMMARY_SUMMARY_LOCK: g_mutex_unlock (summary->priv->summary_lock); break; - case CSS_IO_LOCK: + case CAMEL_STORE_SUMMARY_IO_LOCK: g_mutex_unlock (summary->priv->io_lock); break; - case CSS_REF_LOCK: + case CAMEL_STORE_SUMMARY_REF_LOCK: g_mutex_unlock (summary->priv->ref_lock); break; default: diff --git a/camel/camel-store-summary.h b/camel/camel-store-summary.h index 6f68ef1..55cf406 100644 --- a/camel/camel-store-summary.h +++ b/camel/camel-store-summary.h @@ -108,9 +108,9 @@ typedef enum _CamelStoreSummaryFlags { * Since: 3.0 **/ typedef enum { - CSS_SUMMARY_LOCK, - CSS_IO_LOCK, - CSS_REF_LOCK + CAMEL_STORE_SUMMARY_SUMMARY_LOCK, + CAMEL_STORE_SUMMARY_IO_LOCK, + CAMEL_STORE_SUMMARY_REF_LOCK } CamelStoreSummaryLock; struct _CamelStoreSummary { diff --git a/camel/camel-store.c b/camel/camel-store.c index f4d2e92..a08e725 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -457,9 +457,9 @@ camel_store_create_folder (CamelStore *store, return NULL; } - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); fi = class->create_folder (store, parent_name, folder_name, ex); - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); return fi; } @@ -530,7 +530,7 @@ camel_store_delete_folder (CamelStore *store, camel_exception_init(&local); - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); success = class->delete_folder (store, folder_name, &local); @@ -544,7 +544,7 @@ camel_store_delete_folder (CamelStore *store, else camel_exception_xfer(ex, &local); - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); return success; } @@ -596,7 +596,7 @@ camel_store_rename_folder (CamelStore *store, old_name = g_strdup(old_namein); oldlen = strlen(old_name); - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); /* If the folder is open (or any subfolders of the open folder) We need to rename them atomically with renaming the actual folder path */ @@ -614,7 +614,7 @@ camel_store_rename_folder (CamelStore *store, || ((namelen > oldlen) && strncmp (full_name, old_name, oldlen) == 0 && full_name[oldlen] == '/')) { - camel_folder_lock (folder, CF_REC_LOCK); + camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK); } else { g_ptr_array_remove_index_fast(folders, i); i--; @@ -644,7 +644,7 @@ camel_store_rename_folder (CamelStore *store, camel_folder_rename(folder, new); g_free(new); - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); g_object_unref (folder); } @@ -662,13 +662,13 @@ camel_store_rename_folder (CamelStore *store, /* Failed, just unlock our folders for re-use */ for (i=0;ilen;i++) { folder = folders->pdata[i]; - camel_folder_unlock (folder, CF_REC_LOCK); + camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK); g_object_unref (folder); } } } - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); g_ptr_array_free(folders, TRUE); g_free(old_name); @@ -696,11 +696,11 @@ camel_store_get_inbox (CamelStore *store, class = CAMEL_STORE_GET_CLASS (store); g_return_val_if_fail (class->get_inbox != NULL, NULL); - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); folder = class->get_inbox (store, ex); - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); return folder; } @@ -1233,11 +1233,11 @@ camel_store_folder_subscribed (CamelStore *store, class = CAMEL_STORE_GET_CLASS (store); g_return_val_if_fail (class->folder_subscribed != NULL, FALSE); - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); ret = class->folder_subscribed (store, folder_name); - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); return ret; } @@ -1267,11 +1267,11 @@ camel_store_subscribe_folder (CamelStore *store, class = CAMEL_STORE_GET_CLASS (store); g_return_val_if_fail (class->subscribe_folder != NULL, FALSE); - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); success = class->subscribe_folder (store, folder_name, ex); - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); return success; } @@ -1301,14 +1301,14 @@ camel_store_unsubscribe_folder (CamelStore *store, class = CAMEL_STORE_GET_CLASS (store); g_return_val_if_fail (class->unsubscribe_folder != NULL, FALSE); - camel_store_lock (store, CS_FOLDER_LOCK); + camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK); success = class->unsubscribe_folder (store, folder_name, ex); if (success) cs_delete_cached_folder (store, folder_name); - camel_store_unlock (store, CS_FOLDER_LOCK); + camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK); return success; } @@ -1445,7 +1445,7 @@ camel_store_lock (CamelStore *store, g_return_if_fail (CAMEL_IS_STORE (store)); switch (lock) { - case CS_FOLDER_LOCK: + case CAMEL_STORE_FOLDER_LOCK: g_static_rec_mutex_lock (&store->priv->folder_lock); break; default: @@ -1469,7 +1469,7 @@ camel_store_unlock (CamelStore *store, g_return_if_fail (CAMEL_IS_STORE (store)); switch (lock) { - case CS_FOLDER_LOCK: + case CAMEL_STORE_FOLDER_LOCK: g_static_rec_mutex_unlock (&store->priv->folder_lock); break; default: diff --git a/camel/camel-store.h b/camel/camel-store.h index 65bc51f..44602ee 100644 --- a/camel/camel-store.h +++ b/camel/camel-store.h @@ -64,7 +64,7 @@ G_BEGIN_DECLS * Since: 3.0 **/ typedef enum { - CS_FOLDER_LOCK + CAMEL_STORE_FOLDER_LOCK } CamelStoreLock; typedef struct _CamelFolderInfo { diff --git a/camel/camel-transport.c b/camel/camel-transport.c index 5a1e5bf..9d8925b 100644 --- a/camel/camel-transport.c +++ b/camel/camel-transport.c @@ -105,9 +105,9 @@ camel_transport_send_to (CamelTransport *transport, class = CAMEL_TRANSPORT_GET_CLASS (transport); g_return_val_if_fail (class->send_to != NULL, FALSE); - camel_transport_lock (transport, CT_SEND_LOCK); + camel_transport_lock (transport, CAMEL_TRANSPORT_SEND_LOCK); sent = class->send_to (transport, message, from, recipients, ex); - camel_transport_unlock (transport, CT_SEND_LOCK); + camel_transport_unlock (transport, CAMEL_TRANSPORT_SEND_LOCK); return sent; } @@ -128,7 +128,7 @@ camel_transport_lock (CamelTransport *transport, g_return_if_fail (CAMEL_IS_TRANSPORT (transport)); switch (lock) { - case CT_SEND_LOCK: + case CAMEL_TRANSPORT_SEND_LOCK: g_mutex_lock (transport->priv->send_lock); break; default: @@ -152,7 +152,7 @@ camel_transport_unlock (CamelTransport *transport, g_return_if_fail (CAMEL_IS_TRANSPORT (transport)); switch (lock) { - case CT_SEND_LOCK: + case CAMEL_TRANSPORT_SEND_LOCK: g_mutex_unlock (transport->priv->send_lock); break; default: diff --git a/camel/camel-transport.h b/camel/camel-transport.h index 654c642..310ac91 100644 --- a/camel/camel-transport.h +++ b/camel/camel-transport.h @@ -65,7 +65,7 @@ typedef struct _CamelTransportPrivate CamelTransportPrivate; * Since: 3.0 **/ typedef enum { - CT_SEND_LOCK + CAMEL_TRANSPORT_SEND_LOCK } CamelTransportLock; struct _CamelTransport { diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c index 6f9b8fd..d36316f 100644 --- a/camel/camel-vee-folder.c +++ b/camel/camel-vee-folder.c @@ -328,9 +328,9 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg) gboolean correlating = expression_is_correlating (vf->expression); /* Check the folder hasn't beem removed while we weren't watching */ - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); if (g_list_find (CAMEL_VEE_FOLDER_GET_PRIVATE (vf)->folders, sub) == NULL) { - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); return; } @@ -386,10 +386,10 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg) camel_exception_clear (&ex); } - camel_vee_folder_lock (vf, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK); if (folder_unmatched != NULL) - camel_vee_folder_lock (folder_unmatched, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUMMARY_LOCK); if (matches_changed || matches_added || changes->uid_removed->len||present) { parent_store = camel_folder_get_parent_store (folder); @@ -525,7 +525,7 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg) folder_unmatched->changes = camel_folder_change_info_new (); } - camel_vee_folder_unlock (folder_unmatched, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUMMARY_LOCK); } if (camel_folder_change_info_changed (vf->changes)) { @@ -537,7 +537,7 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg) parent_store = camel_folder_get_parent_store (folder); camel_db_end_transaction (parent_store->cdb_w, NULL); } - camel_vee_folder_unlock (vf, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK); /* Cleanup stuff on our folder */ if (matches_added) @@ -548,7 +548,7 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg) if (matches_changed) camel_folder_search_free (sub, matches_changed); - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* cleanup the rest */ if (newchanged) @@ -573,10 +573,10 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg) * rather be safe than sorry.) */ if ((vf_changes && (vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO) == 0) || correlating) { - camel_vee_folder_lock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); if (g_list_find (vf->priv->folders_changed, sub) == NULL) vf->priv->folders_changed = g_list_prepend (vf->priv->folders_changed, sub); - camel_vee_folder_unlock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); } if (vf_changes) { @@ -594,7 +594,7 @@ subfolder_renamed_update (CamelVeeFolder *vf, CamelFolder *sub, gchar hash[8]) GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL; CamelFolderSummary *ssummary = sub->summary; - camel_vee_folder_lock (vf, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK); camel_folder_summary_prepare_fetch_all (((CamelFolder *)vf)->summary, NULL); @@ -642,7 +642,7 @@ subfolder_renamed_update (CamelVeeFolder *vf, CamelFolder *sub, gchar hash[8]) vf->changes = camel_folder_change_info_new (); } - camel_vee_folder_unlock (vf, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK); if (changes) { camel_object_trigger_event ((CamelObject *)vf, "folder_changed", changes); @@ -871,14 +871,14 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub) gint i; CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL; - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); - camel_vee_folder_lock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); p->folders_changed = g_list_remove (p->folders_changed, sub); - camel_vee_folder_unlock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); if (g_list_find (p->folders, sub) == NULL) { - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); return; } @@ -889,17 +889,17 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub) p->folders = g_list_remove (p->folders, sub); /* undo the freeze state that we have imposed on this source folder */ - camel_folder_lock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK); for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)vf); i++) camel_folder_thaw (sub); - camel_folder_unlock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK); - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); if (folder_unmatched != NULL) { CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched); - camel_vee_folder_lock (folder_unmatched, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* if folder deleted, then blow it away from unmatched always, and remove all refs to it */ if (sub->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) { while (g_list_find (up->folders, sub)) { @@ -907,10 +907,10 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub) g_object_unref (sub); /* undo the freeze state that Unmatched has imposed on this source folder */ - camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++) camel_folder_thaw (sub); - camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); } } else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) { if (g_list_find (up->folders, sub) != NULL) { @@ -918,13 +918,13 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub) g_object_unref (sub); /* undo the freeze state that Unmatched has imposed on this source folder */ - camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++) camel_folder_thaw (sub); - camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); } } - camel_vee_folder_unlock (folder_unmatched, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); } if (CAMEL_IS_VEE_FOLDER (sub)) @@ -1000,10 +1000,10 @@ vee_folder_refresh_info (CamelFolder *folder, GList *node, *list; gboolean success = TRUE; - camel_vee_folder_lock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); list = p->folders_changed; p->folders_changed = NULL; - camel_vee_folder_unlock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); node = list; while (node) { @@ -1035,7 +1035,7 @@ vee_folder_sync (CamelFolder *folder, folder->summary->visible_count = ((CamelVeeSummary *)folder->summary)->fake_visible_count; ((CamelVeeSummary *)folder->summary)->fake_visible_count = 0; - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); node = p->folders; while (node) { @@ -1087,7 +1087,7 @@ vee_folder_sync (CamelFolder *folder, g_slist_foreach (del, (GFunc) camel_pstring_free, NULL); g_slist_free (del); } - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); camel_object_state_write (CAMEL_OBJECT (vf)); @@ -1224,7 +1224,7 @@ vee_folder_search_by_uids (CamelFolder *folder, CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf); GHashTable *searched = g_hash_table_new (NULL, NULL); - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); expr = g_strdup_printf ("(and %s %s)", vf->expression ? vf->expression : "", expression); node = p->folders; @@ -1268,7 +1268,7 @@ vee_folder_search_by_uids (CamelFolder *folder, } g_free (expr); - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); g_hash_table_destroy (searched); g_ptr_array_free (folder_uids, TRUE); @@ -1319,18 +1319,18 @@ vee_folder_delete (CamelFolder *folder) /* NB: this is never called on UNMTACHED */ - camel_vee_folder_lock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); while (p->folders) { CamelFolder *f = p->folders->data; g_object_ref (f); - camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); camel_vee_folder_remove_folder ((CamelVeeFolder *)folder, f); g_object_unref (f); - camel_vee_folder_lock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); } - camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); ((CamelFolderClass *)camel_vee_folder_parent_class)->delete (folder); ((CamelVeeFolder *)folder)->deleted = TRUE; @@ -1343,7 +1343,7 @@ vee_folder_freeze (CamelFolder *folder) CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vfolder); GList *node; - camel_vee_folder_lock (vfolder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); node = p->folders; while (node) { @@ -1353,7 +1353,7 @@ vee_folder_freeze (CamelFolder *folder) node = node->next; } - camel_vee_folder_unlock (vfolder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* call parent implementation */ CAMEL_FOLDER_CLASS (camel_vee_folder_parent_class)->freeze (folder); @@ -1366,7 +1366,7 @@ vee_folder_thaw (CamelFolder *folder) CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vfolder); GList *node; - camel_vee_folder_lock (vfolder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); node = p->folders; while (node) { @@ -1376,7 +1376,7 @@ vee_folder_thaw (CamelFolder *folder) node = node->next; } - camel_vee_folder_unlock (vfolder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* call parent implementation */ CAMEL_FOLDER_CLASS (camel_vee_folder_parent_class)->thaw (folder); @@ -1390,12 +1390,12 @@ vee_folder_set_expression (CamelVeeFolder *vee_folder, GList *node; CamelException ex = CAMEL_EXCEPTION_INITIALISER; - camel_vee_folder_lock (vee_folder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vee_folder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* no change, do nothing */ if ((vee_folder->expression && query && strcmp (vee_folder->expression, query) == 0) || (vee_folder->expression == NULL && query == NULL)) { - camel_vee_folder_unlock (vee_folder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vee_folder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); return; } @@ -1439,12 +1439,12 @@ vee_folder_set_expression (CamelVeeFolder *vee_folder, camel_exception_clear (&ex); - camel_vee_folder_lock (vee_folder, CVF_CHANGED_LOCK); + camel_vee_folder_lock (vee_folder, CAMEL_VEE_FOLDER_CHANGED_LOCK); g_list_free (p->folders_changed); p->folders_changed = NULL; - camel_vee_folder_unlock (vee_folder, CVF_CHANGED_LOCK); + camel_vee_folder_unlock (vee_folder, CAMEL_VEE_FOLDER_CHANGED_LOCK); - camel_vee_folder_unlock (vee_folder, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vee_folder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); } static void @@ -1478,18 +1478,18 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source) if ((source->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED)) killun = TRUE; - camel_vee_folder_lock (vf, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK); if (folder_unmatched != NULL) { /* check if this folder is still to be part of unmatched */ if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !killun) { - camel_vee_folder_lock (folder_unmatched, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); still = g_list_find (CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched)->folders, source) != NULL; - camel_vee_folder_unlock (folder_unmatched, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); camel_vee_folder_hash_folder (source, hash); } - camel_vee_folder_lock (folder_unmatched, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUMMARY_LOCK); /* See if we just blow all uid's from this folder away from unmatched, regardless */ if (killun) { @@ -1578,7 +1578,7 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source) folder_unmatched->changes = camel_folder_change_info_new (); } - camel_vee_folder_unlock (folder_unmatched, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUMMARY_LOCK); } if (camel_folder_change_info_changed (vf->changes)) { @@ -1586,7 +1586,7 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source) vf->changes = camel_folder_change_info_new (); } - camel_vee_folder_unlock (vf, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK); if (unmatched_changes) { camel_object_trigger_event ((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes); @@ -1685,7 +1685,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder, u.rebuilt = rebuilded; u.correlating = correlating; - camel_vee_folder_lock (vee_folder, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (vee_folder, CAMEL_VEE_FOLDER_SUMMARY_LOCK); /* we build 2 hash tables, one for all uid's not matched, the other for all matched uid's, we just ref the real memory */ @@ -1716,7 +1716,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder, } if (folder_unmatched != NULL) - camel_vee_folder_lock (folder_unmatched, CVF_SUMMARY_LOCK); + camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUMMARY_LOCK); /* scan, looking for "old" uid's to be removed. "old" uid's are those that are from previous added sources (not in @@ -1813,7 +1813,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder, folder_unmatched->changes = camel_folder_change_info_new (); } - camel_vee_folder_unlock (folder_unmatched, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUMMARY_LOCK); } if (camel_folder_change_info_changed (vee_folder->changes)) { @@ -1821,7 +1821,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder, vee_folder->changes = camel_folder_change_info_new (); } - camel_vee_folder_unlock (vee_folder, CVF_SUMMARY_LOCK); + camel_vee_folder_unlock (vee_folder, CAMEL_VEE_FOLDER_SUMMARY_LOCK); /* Del the unwanted things from the summary, we don't hold any locks now. */ if (del_list) { @@ -2065,36 +2065,36 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub) return; } - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* for normal vfolders we want only unique ones, for unmatched we want them all recorded */ if (g_list_find (p->folders, sub) == NULL) { p->folders = g_list_append ( p->folders, g_object_ref (sub)); - camel_folder_lock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK); /* update the freeze state of 'sub' to match our freeze state */ for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)vf); i++) camel_folder_freeze (sub); - camel_folder_unlock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK); } if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER (sub) && folder_unmatched != NULL) { CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched); up->folders = g_list_append ( up->folders, g_object_ref (sub)); - camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); /* update the freeze state of 'sub' to match Unmatched's freeze state */ for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++) camel_folder_freeze (sub); - camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); } - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); camel_object_hook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc)folder_changed, vf); camel_object_hook_event ((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc)subfolder_deleted, vf); @@ -2117,14 +2117,14 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub) gint i; CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL; - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); - camel_vee_folder_lock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); p->folders_changed = g_list_remove (p->folders_changed, sub); - camel_vee_folder_unlock (vf, CVF_CHANGED_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_CHANGED_LOCK); if (g_list_find (p->folders, sub) == NULL) { - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); return; } @@ -2135,17 +2135,17 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub) p->folders = g_list_remove (p->folders, sub); /* undo the freeze state that we have imposed on this source folder */ - camel_folder_lock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK); for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)vf); i++) camel_folder_thaw (sub); - camel_folder_unlock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK); - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); if (folder_unmatched != NULL) { CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched); - camel_vee_folder_lock (folder_unmatched, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* if folder deleted, then blow it away from unmatched always, and remove all refs to it */ if (sub->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) { while (g_list_find (up->folders, sub)) { @@ -2153,10 +2153,10 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub) g_object_unref (sub); /* undo the freeze state that Unmatched has imposed on this source folder */ - camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++) camel_folder_thaw (sub); - camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); } } else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) { if (g_list_find (up->folders, sub) != NULL) { @@ -2164,13 +2164,13 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub) g_object_unref (sub); /* undo the freeze state that Unmatched has imposed on this source folder */ - camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++) camel_folder_thaw (sub); - camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK); + camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK); } } - camel_vee_folder_unlock (folder_unmatched, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); } CAMEL_VEE_FOLDER_GET_CLASS (vf)->remove_folder (vf, sub); @@ -2220,14 +2220,14 @@ camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders) CamelFolder *folder; /* setup a table of all folders we have currently */ - camel_vee_folder_lock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); l = p->folders; while (l) { g_hash_table_insert (remove, l->data, l->data); g_object_ref (l->data); l = l->next; } - camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK); + camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK); /* if we already have the folder, ignore it, otherwise add it */ l = folders; @@ -2421,13 +2421,13 @@ camel_vee_folder_lock (CamelVeeFolder *folder, g_return_if_fail (CAMEL_IS_VEE_FOLDER (folder)); switch (lock) { - case CVF_SUMMARY_LOCK: + case CAMEL_VEE_FOLDER_SUMMARY_LOCK: g_mutex_lock (folder->priv->summary_lock); break; - case CVF_SUBFOLDER_LOCK: + case CAMEL_VEE_FOLDER_SUBFOLDER_LOCK: g_mutex_lock (folder->priv->subfolder_lock); break; - case CVF_CHANGED_LOCK: + case CAMEL_VEE_FOLDER_CHANGED_LOCK: g_mutex_lock (folder->priv->changed_lock); break; default: @@ -2451,13 +2451,13 @@ camel_vee_folder_unlock (CamelVeeFolder *folder, g_return_if_fail (CAMEL_IS_VEE_FOLDER (folder)); switch (lock) { - case CVF_SUMMARY_LOCK: + case CAMEL_VEE_FOLDER_SUMMARY_LOCK: g_mutex_unlock (folder->priv->summary_lock); break; - case CVF_SUBFOLDER_LOCK: + case CAMEL_VEE_FOLDER_SUBFOLDER_LOCK: g_mutex_unlock (folder->priv->subfolder_lock); break; - case CVF_CHANGED_LOCK: + case CAMEL_VEE_FOLDER_CHANGED_LOCK: g_mutex_unlock (folder->priv->changed_lock); break; default: diff --git a/camel/camel-vee-folder.h b/camel/camel-vee-folder.h index 90f0bec..a0fe0d0 100644 --- a/camel/camel-vee-folder.h +++ b/camel/camel-vee-folder.h @@ -62,9 +62,9 @@ typedef struct _CamelVeeFolderPrivate CamelVeeFolderPrivate; * Since: 3.0 **/ typedef enum { - CVF_SUMMARY_LOCK, - CVF_SUBFOLDER_LOCK, - CVF_CHANGED_LOCK + CAMEL_VEE_FOLDER_SUMMARY_LOCK, + CAMEL_VEE_FOLDER_SUBFOLDER_LOCK, + CAMEL_VEE_FOLDER_CHANGED_LOCK } CamelVeeFolderLock; struct _CamelVeeFolder { diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c index a1675bd..004749c 100644 --- a/camel/camel-vee-summary.c +++ b/camel/camel-vee-summary.c @@ -333,14 +333,14 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid) /* FIXME[disk-summary] too bad design. Need to peek it from cfs * instead of hacking ugly like this */ - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); info = g_hash_table_lookup (s->loaded_infos, uid); if (info) camel_message_info_ref (info); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (!info) { CamelVeeMessageInfo *vinfo; @@ -465,9 +465,9 @@ camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const gch memcpy(vuid, hash, 8); strcpy(vuid+8, uid); - camel_folder_summary_lock (CAMEL_FOLDER_SUMMARY (s), CFS_SUMMARY_LOCK); + camel_folder_summary_lock (CAMEL_FOLDER_SUMMARY (s), CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); mi = (CamelVeeMessageInfo *) g_hash_table_lookup(((CamelFolderSummary *) s)->loaded_infos, vuid); - camel_folder_summary_unlock (CAMEL_FOLDER_SUMMARY (s), CFS_SUMMARY_LOCK); + camel_folder_summary_unlock (CAMEL_FOLDER_SUMMARY (s), CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); if (mi) { /* Possible that the entry is loaded, see if it has the summary */ diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c index d30c29c..fedfd5b 100644 --- a/camel/providers/groupwise/camel-groupwise-folder.c +++ b/camel/providers/groupwise/camel-groupwise-folder.c @@ -798,13 +798,13 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) return groupwise_sync_summary (folder, ex); - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_groupwise_store_connected (gw_store, ex)) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_exception_clear (ex); return TRUE; } - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); cnc = cnc_lookup (gw_store->priv); container_id = camel_groupwise_store_container_id_lookup (gw_store, full_name); @@ -883,7 +883,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ } if (g_list_length (deleted_items) == GROUPWISE_BULK_DELETE_LIMIT ) { - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* Sync up the READ changes before deleting the message. @@ -908,7 +908,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ status = e_gw_connection_remove_items (cnc, container_id, deleted_items); if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) status = e_gw_connection_remove_items (cnc, container_id, deleted_items); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (status == E_GW_CONNECTION_STATUS_OK) { gchar *uid; while (deleted_items) { @@ -942,7 +942,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ read_items = g_list_concat (read_items, deleted_read_items); if (read_items) { - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_mark_read (cnc, read_items); if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) status = e_gw_connection_mark_read (cnc, read_items); @@ -951,11 +951,11 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ sync_flags (folder, read_items); g_list_free (read_items); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); } if (deleted_items) { - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!strcmp (full_name, "Trash")) { status = e_gw_connection_purge_selected_items (cnc, deleted_items); if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) @@ -978,11 +978,11 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ } } g_list_free (deleted_items); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); } if (unread_items) { - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_mark_unread (cnc, unread_items); if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) status = e_gw_connection_mark_unread (cnc, unread_items); @@ -991,21 +991,21 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_ sync_flags (folder, unread_items); g_list_free (unread_items); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); } if (expunge) { - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_purge_deleted_items (cnc); if (status == E_GW_CONNECTION_STATUS_OK) { g_message ("Purged deleted items in %s", camel_folder_get_name (folder)); } - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); } - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); success = groupwise_sync_summary (folder, ex); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); camel_folder_change_info_free (changes); @@ -1109,7 +1109,7 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg) In case if user went offline, don't do anything. m->cnc would have become invalid, as the store disconnect unrefs it. */ - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL || ((CamelService *)gw_store)->status == CAMEL_SERVICE_DISCONNECTED) { goto end1; @@ -1133,7 +1133,7 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg) while (!done) { if (camel_application_is_exiting) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return; } @@ -1165,7 +1165,7 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg) } e_gw_connection_destroy_cursor (m->cnc, m->container_id, cursor); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* Take out only the first part in the list until the @ since it is guaranteed to be unique only until that symbol */ @@ -1191,7 +1191,7 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg) return; end1: - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_operation_end (NULL); if (items_full_list) { g_list_foreach (items_full_list, (GFunc)g_free, NULL); @@ -1405,7 +1405,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) gw_folder->need_refresh = TRUE; } - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_groupwise_store_connected (gw_store, ex)) goto end1; @@ -1516,7 +1516,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) update_summary_string (folder, new_sync_time, ex); } - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); is_locked = FALSE; /* @@ -1547,7 +1547,7 @@ end2: g_free (container_id); end1: if (is_locked) - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return; } @@ -2458,9 +2458,9 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex) parent_store = camel_folder_get_parent_store (folder); - camel_service_lock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); gw_update_cache (folder, item_list, ex, TRUE); - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_list_foreach (item_list, (GFunc)g_free, NULL); g_list_free (item_list); @@ -2512,7 +2512,7 @@ groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message, } cnc = cnc_lookup (gw_store->priv); - camel_service_lock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); /*Get the container id*/ container_id = camel_groupwise_store_container_id_lookup (gw_store, full_name); @@ -2538,7 +2538,7 @@ groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message, if (appended_uid) *appended_uid = NULL; - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } @@ -2553,14 +2553,14 @@ groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message, if (appended_uid) *appended_uid = NULL; - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } if (appended_uid) *appended_uid = g_strdup (id); g_free (id); - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -2635,7 +2635,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, source_container_id = NULL; dest_container_id = camel_groupwise_store_container_id_lookup (gw_store, destination_full_name); - camel_service_lock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* check for offline operation */ if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) { CamelGroupwiseJournal *journal = (CamelGroupwiseJournal *) ((CamelGroupwiseFolder *) destination)->journal; @@ -2674,7 +2674,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, } } - camel_service_unlock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -2716,9 +2716,9 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, */ wrapper = g_list_prepend (wrapper, (gchar *)uid); - camel_service_lock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); e_gw_connection_mark_read (cnc, wrapper); - camel_service_unlock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_list_free (wrapper); wrapper = NULL; } @@ -2732,9 +2732,9 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, if (unset_flags.bits & CAMEL_MESSAGE_SEEN) { wrapper = g_list_prepend (wrapper, (gchar *)uid); - camel_service_lock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); e_gw_connection_mark_unread (cnc, wrapper); - camel_service_unlock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_list_free (wrapper); wrapper = NULL; } @@ -2791,7 +2791,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, groupwise_store_set_current_folder (gw_store, source); - camel_service_unlock (CAMEL_SERVICE (source_parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (source_parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -2825,7 +2825,7 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex) return TRUE; if (!strcmp (full_name, "Trash")) { - camel_service_lock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_purge_deleted_items (cnc); if (status == E_GW_CONNECTION_STATUS_OK) { camel_folder_freeze (folder); @@ -2833,7 +2833,7 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex) camel_folder_thaw (folder); } else g_warning ("Could not Empty Trash\n"); - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -2857,9 +2857,9 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex) } if (g_list_length (deleted_items) == GROUPWISE_BULK_DELETE_LIMIT ) { /* Read the FIXME below */ - camel_service_lock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_remove_items (cnc, container_id, deleted_items); - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (status == E_GW_CONNECTION_STATUS_OK) { gchar *uid; while (deleted_items) { @@ -2882,9 +2882,9 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex) if (deleted_items) { /* FIXME: Put these in a function and reuse it inside the above loop, here and in groupwise_sync*/ - camel_service_lock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_remove_items (cnc, container_id, deleted_items); - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (status == E_GW_CONNECTION_STATUS_OK) { gchar *uid; while (deleted_items) { diff --git a/camel/providers/groupwise/camel-groupwise-store-summary.c b/camel/providers/groupwise/camel-groupwise-store-summary.c index 8bcd0b6..5a11391 100644 --- a/camel/providers/groupwise/camel-groupwise-store-summary.c +++ b/camel/providers/groupwise/camel-groupwise-store-summary.c @@ -525,10 +525,10 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const switch (type) { case CAMEL_STORE_INFO_LAST: d(printf("Set full name %s -> %s\n", isi->full_name, str)); - camel_store_summary_lock (s, CSS_SUMMARY_LOCK); + camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_free(isi->full_name); isi->full_name = g_strdup(str); - camel_store_summary_unlock (s, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); break; default: CAMEL_STORE_SUMMARY_CLASS (camel_groupwise_store_summary_parent_class)->store_info_set_string(s, mi, type, str); diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c index 25b78e8..7cee3be 100644 --- a/camel/providers/groupwise/camel-groupwise-store.c +++ b/camel/providers/groupwise/camel-groupwise-store.c @@ -264,7 +264,7 @@ void groupwise_store_set_current_folder (CamelGroupwiseStore *groupwise_store, CamelFolder *folder) { - camel_service_lock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (groupwise_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (groupwise_store->current_folder) { g_object_unref (groupwise_store->current_folder); @@ -274,7 +274,7 @@ groupwise_store_set_current_folder (CamelGroupwiseStore *groupwise_store, CamelF if (folder) groupwise_store->current_folder = g_object_ref (folder); - camel_service_unlock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (groupwise_store), CAMEL_SERVICE_REC_CONNECT_LOCK); } static gboolean @@ -300,15 +300,15 @@ groupwise_connect (CamelService *service, CamelException *ex) } - camel_service_lock (service, CS_REC_CONNECT_LOCK); + camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (priv->cnc) { - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } if (!check_for_connection (service, ex) || !groupwise_auth_loop (service, ex)) { - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); camel_service_disconnect (service, TRUE, NULL); return FALSE; } @@ -334,7 +334,7 @@ groupwise_connect (CamelService *service, CamelException *ex) camel_store_summary_save ((CamelStoreSummary *) store->summary); - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (E_IS_GW_CONNECTION (priv->cnc)) { return TRUE; } @@ -403,7 +403,7 @@ groupwise_disconnect (CamelService *service, gboolean clean, CamelException *ex) CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (service); if (clean) { - camel_service_lock (service, CS_REC_CONNECT_LOCK); + camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (groupwise_store->priv && groupwise_store->priv->cnc) { g_object_unref (groupwise_store->priv->cnc); groupwise_store->priv->cnc = NULL; @@ -411,7 +411,7 @@ groupwise_disconnect (CamelService *service, gboolean clean, CamelException *ex) groupwise_store_set_current_folder (groupwise_store, NULL); - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); } /* groupwise_disconnect_cleanup (service, clean, ex); */ @@ -574,18 +574,18 @@ groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags camel_exception_clear (ex); - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); groupwise_store_set_current_folder (gw_store, NULL); if (!camel_groupwise_store_connected (gw_store, ex)) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } if (!E_IS_GW_CONNECTION( priv->cnc)) { if (!groupwise_connect (CAMEL_SERVICE(store), ex)) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } } @@ -597,7 +597,7 @@ groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags g_free(storage_path); folder = camel_gw_folder_new (store, folder_name, folder_dir, ex); if (!folder) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_exception_set ( ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed")); @@ -630,7 +630,7 @@ groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags &cursor); if (status != E_GW_CONNECTION_STATUS_OK) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free (container_id); return NULL; } @@ -648,7 +648,7 @@ groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags all_ok = FALSE; break; /* - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); e_gw_connection_destroy_cursor (priv->cnc, container_id, cursor); //camel_folder_summary_clear (folder->summary); camel_folder_summary_save_to_db (folder->summary, ex); @@ -701,7 +701,7 @@ groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags groupwise_store_set_current_folder (gw_store, folder); g_free (container_id); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return folder; } @@ -727,16 +727,16 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin camel_exception_clear (ex); - camel_service_lock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_groupwise_store_connected (gw_store, ex)) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return; } if (!E_IS_GW_CONNECTION( priv->cnc)) { if (!groupwise_connect (CAMEL_SERVICE((CamelStore*)gw_store), ex)) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return; } } @@ -767,7 +767,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin NULL, &cursor); if (status != E_GW_CONNECTION_STATUS_OK) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free (container_id); return; } @@ -781,7 +781,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin cursor, FALSE, CURSOR_ITEM_LIMIT, position, &list); if (status != E_GW_CONNECTION_STATUS_OK) { - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); e_gw_connection_destroy_cursor (priv->cnc, container_id, cursor); camel_folder_summary_save_to_db (folder->summary, ex); camel_exception_set ( @@ -834,7 +834,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin groupwise_store_set_current_folder (gw_store, NULL); g_free (container_id); - camel_service_unlock (CAMEL_SERVICE (gw_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return; } @@ -1113,7 +1113,7 @@ store_refresh_refresh (CamelSession *session, CamelSessionThreadMsg *msg) struct _store_refresh_msg *m = (struct _store_refresh_msg *)msg; CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE(m->store); - camel_service_lock (CAMEL_SERVICE (m->store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (m->store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_groupwise_store_connected (groupwise_store, &m->ex)) goto done; /*Get the folder list and save it here*/ @@ -1122,7 +1122,7 @@ store_refresh_refresh (CamelSession *session, CamelSessionThreadMsg *msg) goto done; camel_store_summary_save ((CamelStoreSummary *)groupwise_store->summary); done: - camel_service_unlock (CAMEL_SERVICE (m->store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (m->store), CAMEL_SERVICE_REC_CONNECT_LOCK); } static void @@ -1154,18 +1154,18 @@ groupwise_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, C && camel_service_connect ((CamelService *)store, ex))) goto offline; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); groupwise_folders_sync (groupwise_store, ex); if (camel_exception_is_set (ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } camel_store_summary_touch ((CamelStoreSummary *)groupwise_store->summary); camel_store_summary_save ((CamelStoreSummary *)groupwise_store->summary); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); offline: info = groupwise_get_folder_info_offline (store, top, flags, ex); @@ -1187,7 +1187,7 @@ create_junk_folder (CamelStore *store) parent_id = ""; /* TODO: check for offlining*/ - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_modify_junk_settings (priv->cnc, JUNK_ENABLE, 0, 0, JUNK_PERSISTENCE); if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) status = e_gw_connection_modify_junk_settings (priv->cnc, JUNK_ENABLE, 0, 0, JUNK_PERSISTENCE); @@ -1204,7 +1204,7 @@ create_junk_folder (CamelStore *store) g_hash_table_insert (priv->parent_hash, g_strdup(child_container_id), g_strdup(parent_id)); camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root); } - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return root; } @@ -1255,7 +1255,7 @@ groupwise_create_folder(CamelStore *store, return NULL; } } - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); status = e_gw_connection_create_folder(priv->cnc,parent_id,folder_name, &child_container_id); if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) status = e_gw_connection_create_folder(priv->cnc,parent_id,folder_name, &child_container_id); @@ -1269,7 +1269,7 @@ groupwise_create_folder(CamelStore *store, camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root); } - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return root; } @@ -1283,10 +1283,10 @@ groupwise_delete_folder(CamelStore *store, EGwConnectionStatus status; const gchar * container; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_groupwise_store_connected (groupwise_store, ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } @@ -1306,7 +1306,7 @@ groupwise_delete_folder(CamelStore *store, g_hash_table_remove (priv->parent_hash, container); } - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -1331,10 +1331,10 @@ groupwise_rename_folder(CamelStore *store, return FALSE; } - camel_service_lock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (groupwise_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_groupwise_store_connected (groupwise_store, ex)) { - camel_service_unlock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (groupwise_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } @@ -1353,7 +1353,7 @@ groupwise_rename_folder(CamelStore *store, ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot rename GroupWise folder '%s' to '%s'"), old_name, new_name); - camel_service_unlock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (groupwise_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } @@ -1376,7 +1376,7 @@ groupwise_rename_folder(CamelStore *store, g_free (oldpath); g_free (newpath); - camel_service_unlock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (groupwise_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c index 8c98e9f..6134542 100644 --- a/camel/providers/imap/camel-imap-command.c +++ b/camel/providers/imap/camel-imap-command.c @@ -90,7 +90,7 @@ camel_imap_command (CamelImapStore *store, va_list ap; gchar *cmd; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (fmt) { va_start (ap, fmt); @@ -110,7 +110,7 @@ camel_imap_command (CamelImapStore *store, if (!imap_command_start (store, folder, cmd, ex)) { g_free (cmd); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } g_free (cmd); @@ -166,12 +166,12 @@ camel_imap_command_start (CamelImapStore *store, cmd = imap_command_strdup_vprintf (store, fmt, ap); va_end (ap); - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); ok = imap_command_start (store, folder, cmd, ex); g_free (cmd); if (!ok) - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return ok; } @@ -301,7 +301,7 @@ camel_imap_command_continuation (CamelImapStore *store, ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, g_strerror (errno)); camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } @@ -331,7 +331,7 @@ camel_imap_command_response (CamelImapStore *store, gchar **response, gchar *respbuf; if (camel_imap_store_readline (store, &respbuf, ex) < 0) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return CAMEL_IMAP_RESPONSE_ERROR; } @@ -388,7 +388,7 @@ camel_imap_command_response (CamelImapStore *store, gchar **response, if (type == CAMEL_IMAP_RESPONSE_ERROR || type == CAMEL_IMAP_RESPONSE_TAGGED) - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return type; } @@ -405,7 +405,7 @@ imap_read_response (CamelImapStore *store, CamelException *ex) * we're still locked. This lock is owned by response * and gets unlocked when response is freed. */ - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); response = g_new0 (CamelImapResponse, 1); /*FIXME if (store->current_folder && camel_disco_store_status (CAMEL_DISCO_STORE (store)) != CAMEL_DISCO_STORE_RESYNCING) { @@ -671,7 +671,7 @@ camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response) } g_free (response); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); } /** diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 007b869..52115fb 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -735,7 +735,7 @@ imap_refresh_info (CamelFolder *folder, * Also, if this is the INBOX, some servers (cryus) wont tell * us with a NOOP of new messages, so force a reselect which * should do it. */ - camel_service_lock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (camel_application_is_exiting || !camel_imap_store_connected(imap_store, ex)) goto done; @@ -811,7 +811,7 @@ imap_refresh_info (CamelFolder *folder, imap_rescan (folder, camel_folder_summary_count (folder->summary), ex); } done: - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_folder_summary_save_to_db (folder->summary, ex); camel_store_summary_save ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary); @@ -984,7 +984,7 @@ imap_rescan (CamelFolder *folder, gint exists, CamelException *ex) if (summary_got == 0 && summary_len == 0) { camel_operation_end (NULL); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free(new); return TRUE; } @@ -997,7 +997,7 @@ imap_rescan (CamelFolder *folder, gint exists, CamelException *ex) g_free (new); if (type != CAMEL_IMAP_RESPONSE_ERROR && type != CAMEL_IMAP_RESPONSE_TAGGED) - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -1442,7 +1442,7 @@ imap_sync (CamelFolder *folder, } camel_exception_init (&local_ex); - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* write local changes first */ replay_offline_journal (store, imap_folder, ex); @@ -1555,7 +1555,7 @@ imap_sync (CamelFolder *folder, g_ptr_array_free (matches, TRUE); /* We unlock here so that other threads can have a chance to grab the connect_lock */ - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* check for an exception */ if (camel_exception_is_set (&local_ex)) { @@ -1564,7 +1564,7 @@ imap_sync (CamelFolder *folder, } /* Re-lock the connect_lock */ - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); } if (expunge) @@ -1576,7 +1576,7 @@ imap_sync (CamelFolder *folder, /* Save the summary */ success = imap_sync_offline (folder, ex); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -1659,11 +1659,11 @@ imap_expunge_uids_online (CamelFolder *folder, store = CAMEL_IMAP_STORE (parent_store); full_expunge = (store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if ((store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0) { if (!CAMEL_FOLDER_GET_CLASS (folder)->sync (folder, 0, ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } } @@ -1678,7 +1678,7 @@ imap_expunge_uids_online (CamelFolder *folder, if (response) camel_imap_response_free (store, response); else { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free (set); return FALSE; } @@ -1709,7 +1709,7 @@ imap_expunge_uids_online (CamelFolder *folder, g_free (set); } - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); changes = camel_folder_change_info_new (); for (i = 0; i < uids->len; i++) { @@ -1785,21 +1785,21 @@ camel_imap_expunge_uids_resyncing (CamelFolder *folder, * marked un-deleted. */ - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!CAMEL_FOLDER_GET_CLASS (folder)->sync (folder, 0, ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } response = camel_imap_command (store, folder, ex, "UID SEARCH DELETED"); if (!response) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } result = camel_imap_response_extract (store, response, "SEARCH", ex); if (!result) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } @@ -1860,7 +1860,7 @@ camel_imap_expunge_uids_resyncing (CamelFolder *folder, if (!response) { g_ptr_array_free (keep_uids, TRUE); g_ptr_array_free (mark_uids, TRUE); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } camel_imap_response_free (store, response); @@ -1884,7 +1884,7 @@ camel_imap_expunge_uids_resyncing (CamelFolder *folder, if (!response) { g_ptr_array_free (keep_uids, TRUE); g_ptr_array_free (mark_uids, TRUE); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } camel_imap_response_free (store, response); @@ -1924,7 +1924,7 @@ camel_imap_expunge_uids_resyncing (CamelFolder *folder, /* now we can free this, now that we're done with keep_uids */ g_free (result); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -2171,11 +2171,11 @@ imap_append_online (CamelFolder *folder, camel_imap_response_free (store, response); /* Make sure a "folder_changed" is emitted. */ - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (store->current_folder != folder || camel_folder_summary_count (folder->summary) == count) success = imap_refresh_info (folder, ex); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -2246,10 +2246,10 @@ imap_transfer_offline (CamelFolder *source, * deadlock in the case where we're simultaneously also trying * to copy messages in the other direction from another thread. */ - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); CAMEL_IMAP_FOLDER_REC_LOCK (source, cache_lock); CAMEL_IMAP_FOLDER_REC_LOCK (dest, cache_lock); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (transferred_uids) { *transferred_uids = g_ptr_array_new (); @@ -3152,9 +3152,9 @@ imap_get_message (CamelFolder *folder, gchar *body, *found_uid; gint i; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected(store, ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_exception_set ( ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, _("This message is not currently available")); @@ -3162,7 +3162,7 @@ imap_get_message (CamelFolder *folder, } response = camel_imap_command (store, folder, ex, "UID FETCH %s BODY", uid); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (response) { for (i = 0, body = NULL; i < response->untagged->len; i++) { @@ -3672,7 +3672,7 @@ imap_update_summary (CamelFolder *folder, if (type == CAMEL_IMAP_RESPONSE_ERROR || camel_application_is_exiting) { if (type != CAMEL_IMAP_RESPONSE_ERROR && type != CAMEL_IMAP_RESPONSE_TAGGED) - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); goto lose; } @@ -3741,7 +3741,7 @@ imap_update_summary (CamelFolder *folder, camel_operation_end (NULL); if (type != CAMEL_IMAP_RESPONSE_ERROR && type != CAMEL_IMAP_RESPONSE_TAGGED) - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); goto lose; } @@ -4031,7 +4031,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const gchar *uid, camel_exception_clear(ex); - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock); if (!camel_imap_store_connected(store, ex)) { @@ -4039,7 +4039,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const gchar *uid, ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, _("This message is not currently available")); CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } @@ -4055,7 +4055,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const gchar *uid, section_text); } /* We won't need the connect_lock again after this. */ - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!response) { CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); @@ -4251,7 +4251,7 @@ imap_get_quota_info (CamelFolder *folder) if (CAMEL_OFFLINE_STORE (imap_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) return NULL; - camel_service_lock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected (imap_store, NULL)) goto done; @@ -4328,7 +4328,7 @@ imap_get_quota_info (CamelFolder *folder) g_free (folder_name); } done: - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return res; } diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c index 30081cd..0e7b1f3 100644 --- a/camel/providers/imap/camel-imap-store-summary.c +++ b/camel/providers/imap/camel-imap-store-summary.c @@ -665,10 +665,10 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const switch (type) { case CAMEL_IMAP_STORE_INFO_FULL_NAME: d(printf("Set full name %s -> %s\n", isi->full_name, str)); - camel_store_summary_lock (s, CSS_SUMMARY_LOCK); + camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_free(isi->full_name); isi->full_name = g_strdup(str); - camel_store_summary_unlock (s, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); break; default: CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->store_info_set_string(s, mi, type, str); diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 60c4441..b1beee2 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -861,11 +861,11 @@ query_auth_types (CamelService *service, CamelException *ex) return NULL; } - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); connected = store->istream != NULL && store->connected; if (!connected) connected = connect_to_server_wrapper (service, ex); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!connected) return NULL; @@ -1270,10 +1270,10 @@ imap_connect (CamelService *service, CamelException *ex) if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) return TRUE; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!connect_to_server_wrapper (service, ex) || !imap_auth_loop (service, ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_service_disconnect (service, TRUE, NULL); return FALSE; } @@ -1428,7 +1428,7 @@ done: /* save any changes we had */ camel_store_summary_save((CamelStoreSummary *)store->summary); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (camel_exception_is_set (ex)) camel_service_disconnect (service, TRUE, NULL); @@ -1509,7 +1509,7 @@ imap_noop (CamelStore *store, CamelFolder *current_folder; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected(imap_store, ex)) { success = FALSE; @@ -1528,7 +1528,7 @@ imap_noop (CamelStore *store, success = FALSE; } done: - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -1722,10 +1722,10 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc camel_exception_clear(ex); - camel_service_lock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected(imap_store, ex)) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } @@ -1743,14 +1743,14 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc const gchar *c; if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } camel_exception_clear (ex); if (!(flags & CAMEL_STORE_FOLDER_CREATE)) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_exception_setv ( ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, _("No such folder %s"), folder_name); @@ -1763,7 +1763,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc c++; if (*c != '\0') { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_exception_setv ( ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH, _("The folder name \"%s\" is invalid because it contains the character \"%c\""), @@ -1785,7 +1785,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc gint i; if (!(response = camel_imap_command (imap_store, NULL, ex, "LIST \"\" %G", parent_real))) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free (parent_name); g_free (parent_real); return NULL; @@ -1831,7 +1831,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc camel_exception_set ( ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE, _("The parent folder is not allowed to contain subfolders")); - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free (parent_name); g_free (parent_real); return NULL; @@ -1841,7 +1841,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc camel_exception_init (&lex); delete_folder (store, parent_name, &lex); if (camel_exception_is_set (&lex)) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_exception_xfer (ex, &lex); g_free (parent_name); g_free (parent_real); @@ -1855,7 +1855,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc g_free (name); if (!response) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); g_free (parent_name); g_free (parent_real); return NULL; @@ -1879,7 +1879,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc } g_free(folder_real); if (!response) { - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } } else if (flags & CAMEL_STORE_FOLDER_EXCL) { @@ -1890,7 +1890,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc camel_imap_response_free_without_processing (imap_store, response); - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } @@ -1912,7 +1912,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc } camel_imap_response_free_without_processing (imap_store, response); - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return new_folder; } @@ -1964,7 +1964,7 @@ delete_folder (CamelStore *store, CamelImapResponse *response; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected(imap_store, ex)) { success = FALSE; @@ -1992,7 +1992,7 @@ delete_folder (CamelStore *store, success = FALSE; fail: - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -2076,7 +2076,7 @@ rename_folder (CamelStore *store, gchar *oldpath, *newpath, *storage_path; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected(imap_store, ex)) { success = FALSE; @@ -2154,7 +2154,7 @@ rename_folder (CamelStore *store, g_free (newpath); fail: imap_store->renaming = FALSE; - camel_service_unlock (CAMEL_SERVICE (imap_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -2627,7 +2627,7 @@ refresh_refresh(CamelSession *session, CamelSessionThreadMsg *msg) struct _refresh_msg *m = (struct _refresh_msg *)msg; CamelImapStore *store = (CamelImapStore *)m->store; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected (store, &m->ex)) goto done; @@ -2643,7 +2643,7 @@ refresh_refresh(CamelSession *session, CamelSessionThreadMsg *msg) get_folders_sync (store, NULL, &m->ex); camel_store_summary_save ((CamelStoreSummary *)store->summary); done: - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); } static void @@ -2692,7 +2692,7 @@ get_folder_info (CamelStore *store, now = time(NULL); ref = now > imap_store->refresh_stamp+60*60*1; if (ref) { - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); ref = now > imap_store->refresh_stamp+60*60*1; if (ref) { struct _refresh_msg *m; @@ -2704,14 +2704,14 @@ get_folder_info (CamelStore *store, camel_exception_init(&m->ex); camel_session_thread_queue(((CamelService *)store)->session, &m->msg, 0); } - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); } } else { gchar *pattern; gint i; CamelImapStoreNamespace *ns; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected((CamelImapStore *)store, ex)) goto fail; @@ -2744,14 +2744,14 @@ get_folder_info (CamelStore *store, get_folders_sync(imap_store, pattern, ex); } camel_store_summary_save((CamelStoreSummary *)imap_store->summary); - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); } tree = get_folder_info_offline(store, top, flags, ex); return tree; fail: - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return NULL; } @@ -2887,7 +2887,7 @@ subscribe_folder (CamelStore *store, CamelStoreInfo *si; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected (imap_store, ex)) { success = FALSE; @@ -2926,7 +2926,7 @@ subscribe_folder (CamelStore *store, camel_object_trigger_event (CAMEL_OBJECT (store), "folder_subscribed", fi); camel_folder_info_free (fi); done: - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -2940,7 +2940,7 @@ unsubscribe_folder (CamelStore *store, CamelImapResponse *response; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (!camel_imap_store_connected (imap_store, ex)) { success = FALSE; @@ -2959,7 +2959,7 @@ unsubscribe_folder (CamelStore *store, success = imap_folder_effectively_unsubscribed (imap_store, folder_name, ex); done: - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c index ec5159d..a235880 100644 --- a/camel/providers/imapx/camel-imapx-server.c +++ b/camel/providers/imapx/camel-imapx-server.c @@ -3977,7 +3977,7 @@ camel_imapx_server_connect (CamelIMAPXServer *is, gboolean connect, CamelExcepti { gboolean ret = FALSE; - camel_service_lock (CAMEL_SERVICE (is->store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (is->store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (connect) { if (is->state == IMAPX_AUTHENTICATED || is->state == IMAPX_SELECTED) { ret = TRUE; @@ -4004,7 +4004,7 @@ camel_imapx_server_connect (CamelIMAPXServer *is, gboolean connect, CamelExcepti } exit: - camel_service_unlock (CAMEL_SERVICE (is->store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (is->store), CAMEL_SERVICE_REC_CONNECT_LOCK); return ret; } diff --git a/camel/providers/imapx/camel-imapx-store-summary.c b/camel/providers/imapx/camel-imapx-store-summary.c index 4d2c277..9711bd9 100644 --- a/camel/providers/imapx/camel-imapx-store-summary.c +++ b/camel/providers/imapx/camel-imapx-store-summary.c @@ -636,10 +636,10 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const switch (type) { case CAMEL_IMAPX_STORE_INFO_FULL_NAME: d(printf("Set full name %s -> %s\n", isi->full_name, str)); - camel_store_summary_lock (s, CSS_SUMMARY_LOCK); + camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_free(isi->full_name); isi->full_name = g_strdup(str); - camel_store_summary_unlock (s, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); break; default: store_summary_class->store_info_set_string(s, mi, type, str); diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c index 007cfb4..6d1f410 100644 --- a/camel/providers/imapx/camel-imapx-store.c +++ b/camel/providers/imapx/camel-imapx-store.c @@ -173,7 +173,7 @@ imapx_query_auth_types (CamelService *service, CamelException *ex) return NULL; } - camel_service_lock (service, CS_REC_CONNECT_LOCK); + camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (istore->server == NULL) istore->server = camel_imapx_server_new((CamelStore *)istore, service->url); @@ -181,7 +181,7 @@ imapx_query_auth_types (CamelService *service, CamelException *ex) connected = istore->server->stream != NULL; if (!connected) connected = imapx_connect_to_server (istore->server, ex); - camel_service_unlock (service, CS_REC_CONNECT_LOCK); + camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK); if (!connected) return NULL; diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c index 33f3ed7..0d12156 100644 --- a/camel/providers/local/camel-mh-summary.c +++ b/camel/providers/local/camel-mh-summary.c @@ -275,8 +275,8 @@ mh_summary_check (CamelLocalSummary *cls, g_hash_table_destroy(left); /* sort the summary based on message number (uid), since the directory order is not useful */ - camel_folder_summary_lock (s, CFS_SUMMARY_LOCK); - camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK); + camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); + camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); return 0; } diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c index d2c26c2..f1ff319 100644 --- a/camel/providers/nntp/camel-nntp-folder.c +++ b/camel/providers/nntp/camel-nntp-folder.c @@ -102,7 +102,7 @@ nntp_folder_refresh_info_online (CamelFolder *folder, nntp_folder = CAMEL_NNTP_FOLDER (folder); nntp_store = CAMEL_NNTP_STORE (parent_store); - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); success = camel_nntp_command ( nntp_store, ex, nntp_folder, &line, NULL); @@ -112,7 +112,7 @@ nntp_folder_refresh_info_online (CamelFolder *folder, nntp_folder->changes = camel_folder_change_info_new(); } - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (changes) { camel_object_trigger_event ((CamelObject *) folder, "folder_changed", changes); @@ -149,7 +149,7 @@ nntp_folder_sync (CamelFolder *folder, CamelException *ex) parent_store = camel_folder_get_parent_store (folder); - camel_service_lock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); changed = camel_folder_summary_get_changed (folder->summary); if (changed) { @@ -160,7 +160,7 @@ nntp_folder_sync (CamelFolder *folder, CamelException *ex) } success = camel_folder_summary_save_to_db (folder->summary, ex); - camel_service_unlock (CAMEL_SERVICE (parent_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -279,7 +279,7 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder, } *msgid++ = 0; - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); stream = nntp_folder_download_message ( (CamelNNTPFolder *) disco_folder, article, msgid, ex); @@ -288,7 +288,7 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder, else success = FALSE; - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -320,7 +320,7 @@ nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException * } *msgid++ = 0; - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* Lookup in cache, NEWS is global messageid's so use a global cache path */ stream = camel_data_cache_get (nntp_store->cache, "cache", msgid, NULL); @@ -361,7 +361,7 @@ fail: changes = NULL; } - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (changes) { camel_object_trigger_event ((CamelObject *) folder, "folder_changed", changes); @@ -466,7 +466,7 @@ nntp_folder_append_message_online (CamelFolder *folder, nntp_store = CAMEL_NNTP_STORE (parent_store); stream = CAMEL_STREAM (nntp_store->stream); - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); /* send 'POST' command */ ret = camel_nntp_command (nntp_store, ex, NULL, &line, "post"); @@ -482,7 +482,7 @@ nntp_folder_append_message_online (CamelFolder *folder, _("Posting failed: %s"), line); success = FALSE; } - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -541,7 +541,7 @@ nntp_folder_append_message_online (CamelFolder *folder, g_free(group); header->next = savedhdrs; - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } diff --git a/camel/providers/nntp/camel-nntp-store-summary.c b/camel/providers/nntp/camel-nntp-store-summary.c index a5cf6d7..01ecb9f 100644 --- a/camel/providers/nntp/camel-nntp-store-summary.c +++ b/camel/providers/nntp/camel-nntp-store-summary.c @@ -384,10 +384,10 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const switch (type) { case CAMEL_NNTP_STORE_INFO_FULL_NAME: d(printf("Set full name %s -> %s\n", nsi->full_name, str)); - camel_store_summary_lock (s, CSS_SUMMARY_LOCK); + camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); g_free (nsi->full_name); nsi->full_name = g_strdup (str); - camel_store_summary_unlock (s, CSS_SUMMARY_LOCK); + camel_store_summary_unlock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK); break; default: CAMEL_STORE_SUMMARY_CLASS (camel_nntp_store_summary_parent_class)->store_info_set_string (s, mi, type, str); diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index f572143..c3b05ea 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -215,7 +215,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca guint len; gchar *path; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (ssl_mode != MODE_CLEAR) { #ifdef HAVE_SSL @@ -307,7 +307,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca store->current_folder = NULL; fail: - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return retval; } @@ -413,7 +413,7 @@ nntp_disconnect_online (CamelService *service, gboolean clean, CamelException *e service_class = CAMEL_SERVICE_GET_CLASS (service); - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (clean) { camel_nntp_raw_command (store, ex, &line, "quit"); @@ -421,7 +421,7 @@ nntp_disconnect_online (CamelService *service, gboolean clean, CamelException *e } if (!service_class->disconnect (service, clean, ex)) { - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return FALSE; } @@ -430,7 +430,7 @@ nntp_disconnect_online (CamelService *service, gboolean clean, CamelException *e g_free(store->current_folder); store->current_folder = NULL; - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); return TRUE; } @@ -478,11 +478,11 @@ nntp_get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, Came CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store); CamelFolder *folder; - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); folder = camel_nntp_folder_new(store, folder_name, ex); - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return folder; } @@ -667,13 +667,13 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const gchar *top, if (folder) { CamelFolderChangeInfo *changes = NULL; - camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_nntp_command(store, ex, folder, &line, NULL); if (camel_folder_change_info_changed(folder->changes)) { changes = folder->changes; folder->changes = camel_folder_change_info_new(); } - camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (changes) { camel_object_trigger_event((CamelObject *) folder, "folder_changed", changes); camel_folder_change_info_free(changes); @@ -826,7 +826,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const gchar *top, gui gint ret = -1; CamelFolderInfo *fi = NULL; - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); if (top == NULL) top = ""; @@ -897,7 +897,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const gchar *top, gui fi = nntp_store_get_cached_folder_info (nntp_store, top, flags, ex); error: - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return fi; } @@ -960,7 +960,7 @@ nntp_store_subscribe_folder (CamelStore *store, const gchar *folder_name, CamelFolderInfo *fi; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); si = camel_store_summary_path(CAMEL_STORE_SUMMARY(nntp_store->summary), folder_name); if (!si) { @@ -977,14 +977,14 @@ nntp_store_subscribe_folder (CamelStore *store, const gchar *folder_name, fi->flags |= CAMEL_FOLDER_NOINFERIORS | CAMEL_FOLDER_NOCHILDREN; camel_store_summary_touch ((CamelStoreSummary *) nntp_store->summary); camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary); - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_object_trigger_event ((CamelObject *) nntp_store, "folder_subscribed", fi); camel_folder_info_free (fi); return TRUE; } } - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } @@ -998,7 +998,7 @@ nntp_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelStoreInfo *fitem; gboolean success = TRUE; - camel_service_lock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_lock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); fitem = camel_store_summary_path(CAMEL_STORE_SUMMARY(nntp_store->summary), folder_name); @@ -1014,14 +1014,14 @@ nntp_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name, fi = nntp_folder_info_from_store_info (nntp_store, nntp_store->do_short_folder_notation, fitem); camel_store_summary_touch ((CamelStoreSummary *) nntp_store->summary); camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary); - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); camel_object_trigger_event ((CamelObject *) nntp_store, "folder_unsubscribed", fi); camel_folder_info_free (fi); return TRUE; } } - camel_service_unlock (CAMEL_SERVICE (nntp_store), CS_REC_CONNECT_LOCK); + camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK); return success; } diff --git a/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml b/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml index 757038c..75aaabf 100644 --- a/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml +++ b/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml @@ -27,6 +27,7 @@ e-cal-check-timezones @comp: @comps: +@const gchar *tzid, gconstpointer custom, GError **error: @const gchar *tzid, gconstpointer custom, GError **error: @custom: @error: diff --git a/docs/reference/camel/tmpl/camel-certdb.sgml b/docs/reference/camel/tmpl/camel-certdb.sgml index 6ff021b..3f9a2ed 100644 --- a/docs/reference/camel/tmpl/camel-certdb.sgml +++ b/docs/reference/camel/tmpl/camel-certdb.sgml @@ -297,10 +297,10 @@ CamelCertDB -@CCD_DB_LOCK: -@CCD_IO_LOCK: -@CCD_ALLOC_LOCK: -@CCD_REF_LOCK: +@CAMEL_CERTDB_DB_LOCK: +@CAMEL_CERTDB_IO_LOCK: +@CAMEL_CERTDB_ALLOC_LOCK: +@CAMEL_CERTDB_REF_LOCK: diff --git a/docs/reference/camel/tmpl/camel-cipher-context.sgml b/docs/reference/camel/tmpl/camel-cipher-context.sgml index 344d6d5..62a59a0 100644 --- a/docs/reference/camel/tmpl/camel-cipher-context.sgml +++ b/docs/reference/camel/tmpl/camel-cipher-context.sgml @@ -345,6 +345,10 @@ CamelCipherContext @gpointer cert_data: @gpointer cert_data: @gpointer cert_data: +@gpointer cert_data: +@gpointer cert_data: +@gpointer cert_data: +@gpointer cert_data: @gpointer cert_data: diff --git a/docs/reference/camel/tmpl/camel-data-wrapper.sgml b/docs/reference/camel/tmpl/camel-data-wrapper.sgml index 20426b8..8ba63c2 100644 --- a/docs/reference/camel/tmpl/camel-data-wrapper.sgml +++ b/docs/reference/camel/tmpl/camel-data-wrapper.sgml @@ -115,7 +115,7 @@ CamelDataWrapper -@CDW_STREAM_LOCK: +@CAMEL_DATA_WRAPPER_STREAM_LOCK: diff --git a/docs/reference/camel/tmpl/camel-folder-summary.sgml b/docs/reference/camel/tmpl/camel-folder-summary.sgml index b5a4235..d17dbe5 100644 --- a/docs/reference/camel/tmpl/camel-folder-summary.sgml +++ b/docs/reference/camel/tmpl/camel-folder-summary.sgml @@ -1052,11 +1052,11 @@ CamelFolderSummary -@CFS_SUMMARY_LOCK: -@CFS_IO_LOCK: -@CFS_FILTER_LOCK: -@CFS_ALLOC_LOCK: -@CFS_REF_LOCK: +@CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK: +@CAMEL_FOLDER_SUMMARY_IO_LOCK: +@CAMEL_FOLDER_SUMMARY_FILTER_LOCK: +@CAMEL_FOLDER_SUMMARY_ALLOC_LOCK: +@CAMEL_FOLDER_SUMMARY_REF_LOCK: diff --git a/docs/reference/camel/tmpl/camel-folder.sgml b/docs/reference/camel/tmpl/camel-folder.sgml index 3cc749e..b4c3f66 100644 --- a/docs/reference/camel/tmpl/camel-folder.sgml +++ b/docs/reference/camel/tmpl/camel-folder.sgml @@ -789,8 +789,8 @@ CamelFolder -@CF_CHANGE_LOCK: -@CF_REC_LOCK: +@CAMEL_FOLDER_CHANGE_LOCK: +@CAMEL_FOLDER_REC_LOCK: diff --git a/docs/reference/camel/tmpl/camel-service.sgml b/docs/reference/camel/tmpl/camel-service.sgml index f625811..de3c534 100644 --- a/docs/reference/camel/tmpl/camel-service.sgml +++ b/docs/reference/camel/tmpl/camel-service.sgml @@ -149,8 +149,8 @@ CamelService -@CS_REC_CONNECT_LOCK: -@CS_CONNECT_OP_LOCK: +@CAMEL_SERVICE_REC_CONNECT_LOCK: +@CAMEL_SERVICE_CONNECT_OP_LOCK: diff --git a/docs/reference/camel/tmpl/camel-session.sgml b/docs/reference/camel/tmpl/camel-session.sgml index 124429b..ebb3089 100644 --- a/docs/reference/camel/tmpl/camel-session.sgml +++ b/docs/reference/camel/tmpl/camel-session.sgml @@ -332,8 +332,8 @@ CamelSession -@CS_SESSION_LOCK: -@CS_THREAD_LOCK: +@CAMEL_SESSION_SESSION_LOCK: +@CAMEL_SESSION_THREAD_LOCK: diff --git a/docs/reference/camel/tmpl/camel-store-summary.sgml b/docs/reference/camel/tmpl/camel-store-summary.sgml index f780a63..118408d 100644 --- a/docs/reference/camel/tmpl/camel-store-summary.sgml +++ b/docs/reference/camel/tmpl/camel-store-summary.sgml @@ -326,9 +326,9 @@ CamelStoreSummary -@CSS_SUMMARY_LOCK: -@CSS_IO_LOCK: -@CSS_REF_LOCK: +@CAMEL_STORE_SUMMARY_SUMMARY_LOCK: +@CAMEL_STORE_SUMMARY_IO_LOCK: +@CAMEL_STORE_SUMMARY_REF_LOCK: diff --git a/docs/reference/camel/tmpl/camel-store.sgml b/docs/reference/camel/tmpl/camel-store.sgml index 1ad8b7a..11ecfa6 100644 --- a/docs/reference/camel/tmpl/camel-store.sgml +++ b/docs/reference/camel/tmpl/camel-store.sgml @@ -551,7 +551,7 @@ CamelStore -@CS_FOLDER_LOCK: +@CAMEL_STORE_FOLDER_LOCK: diff --git a/docs/reference/camel/tmpl/camel-transport.sgml b/docs/reference/camel/tmpl/camel-transport.sgml index cb8a6c8..5e87fac 100644 --- a/docs/reference/camel/tmpl/camel-transport.sgml +++ b/docs/reference/camel/tmpl/camel-transport.sgml @@ -44,7 +44,7 @@ CamelTransport -@CT_SEND_LOCK: +@CAMEL_TRANSPORT_SEND_LOCK: diff --git a/docs/reference/camel/tmpl/camel-vee-folder.sgml b/docs/reference/camel/tmpl/camel-vee-folder.sgml index b23a34b..a1fa0ee 100644 --- a/docs/reference/camel/tmpl/camel-vee-folder.sgml +++ b/docs/reference/camel/tmpl/camel-vee-folder.sgml @@ -170,9 +170,9 @@ CamelVeeFolder -@CVF_SUMMARY_LOCK: -@CVF_SUBFOLDER_LOCK: -@CVF_CHANGED_LOCK: +@CAMEL_VEE_FOLDER_SUMMARY_LOCK: +@CAMEL_VEE_FOLDER_SUBFOLDER_LOCK: +@CAMEL_VEE_FOLDER_CHANGED_LOCK: