Public Camel symbols need to be in the "camel" namespace.
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
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;
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;
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);
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)
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;
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);
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;
}
{
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;
}
certdb->flags |= CAMEL_CERTDB_DIRTY;
- camel_certdb_unlock (certdb, CCD_DB_LOCK);
+ camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK);
}
void
{
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);
certdb->flags |= CAMEL_CERTDB_DIRTY;
}
- camel_certdb_unlock (certdb, CCD_DB_LOCK);
+ camel_certdb_unlock (certdb, CAMEL_CERTDB_DB_LOCK);
}
static CamelCert *
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;
}
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
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);
cert->refcount--;
}
- camel_certdb_unlock (certdb, CCD_REF_LOCK);
+ camel_certdb_unlock (certdb, CAMEL_CERTDB_REF_LOCK);
}
static gboolean
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++) {
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 *
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:
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:
* 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 {
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;
}
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:
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:
* Since: 3.0
**/
typedef enum {
- CDW_STREAM_LOCK
+ CAMEL_DATA_WRAPPER_STREAM_LOCK
} CamelDataWrapperLock;
struct _CamelDataWrapper {
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);
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);
}
/**
{
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;
/* 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;
}
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 (i<s->uids->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;
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; i<s->uids->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;
}
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;i<s->uids->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;
}
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;i<s->uids->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;
}
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);
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);
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;
}
{
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);*/
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);
}
/**
* 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;
}
{
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;
}
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 */
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);
}
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);
}
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);
}
/**
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);
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;
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;
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
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? */
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);
}
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;
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);
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);
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);
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;
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;
}
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. */
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);
}
/**
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. */
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
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)
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;
}
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)
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;
}
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);
}
/**
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;
}
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);
}
/**
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;
}
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);
}
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));
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);
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 {
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);
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);
}
}
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);
}
}
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) {
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);
}
}
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;
}
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));
}
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);
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
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:
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:
} 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 {
{
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
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--;
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);
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;
}
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;
}
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;
}
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;
}
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",
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)
}
}
- camel_folder_unlock (folder, CF_REC_LOCK);
+ camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK);
return success;
}
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);
}
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);
}
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);
}
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);
}
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;
}
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);
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;
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);
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;
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;
* Since: 3.0
**/
typedef enum {
- CF_CHANGE_LOCK,
- CF_REC_LOCK
+ CAMEL_FOLDER_CHANGE_LOCK,
+ CAMEL_FOLDER_REC_LOCK
} CamelFolderLock;
struct _CamelFolderChangeInfo {
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);
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);
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;
}
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;
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);
}
/**
/* 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;
}
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:
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:
* 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 {
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;
}
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));
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 (
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);
/* 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);
}
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;
}
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:
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:
* Since: 3.0
**/
typedef enum {
- CS_SESSION_LOCK,
- CS_THREAD_LOCK
+ CAMEL_SESSION_SESSION_LOCK,
+ CAMEL_SESSION_THREAD_LOCK
} CamelSessionLock;
struct _CamelSession {
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)
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);
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) {
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");
{
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);
}
/**
{
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);
}
/**
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;
}
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);
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;
}
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;
}
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;
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;
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;
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;
}
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;
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;
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);
}
/**
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) {
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;
}
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);
}
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);
}
/**
{
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);
}
/**
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;
}
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);
}
/**
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);
}
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);
}
}
{
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];
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);
}
}
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:
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:
* 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 {
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;
}
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);
else
camel_exception_xfer(ex, &local);
- camel_store_unlock (store, CS_FOLDER_LOCK);
+ camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
return success;
}
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 */
|| ((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--;
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);
}
/* Failed, just unlock our folders for re-use */
for (i=0;i<folders->len;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);
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;
}
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;
}
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;
}
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;
}
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:
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:
* Since: 3.0
**/
typedef enum {
- CS_FOLDER_LOCK
+ CAMEL_STORE_FOLDER_LOCK
} CamelStoreLock;
typedef struct _CamelFolderInfo {
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;
}
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:
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:
* Since: 3.0
**/
typedef enum {
- CT_SEND_LOCK
+ CAMEL_TRANSPORT_SEND_LOCK
} CamelTransportLock;
struct _CamelTransport {
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;
}
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);
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)) {
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)
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)
* 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) {
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);
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);
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;
}
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)) {
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) {
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))
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) {
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) {
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));
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;
}
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);
/* 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;
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) {
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);
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) {
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);
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;
}
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
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) {
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)) {
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);
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 */
}
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
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)) {
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) {
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);
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;
}
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)) {
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) {
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);
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;
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:
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:
* 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 {
/* 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;
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 */
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);
}
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.
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) {
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);
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)
}
}
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);
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);
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;
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;
}
}
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 */
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);
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;
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;
/*
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;
}
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);
}
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);
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 = 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;
}
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;
}
}
- 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;
}
*/
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;
}
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;
}
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;
}
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);
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;
}
}
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) {
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) {
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);
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);
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
}
- 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;
}
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;
}
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;
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); */
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;
}
}
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"));
&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;
}
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);
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;
}
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;
}
}
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;
}
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 (
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;
}
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*/
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
&& 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);
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);
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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);
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;
}
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;
}
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;
}
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;
}
* 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) {
}
g_free (response);
- camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK);
+ camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
}
/**
* 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;
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);
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;
}
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;
}
}
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);
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)) {
}
/* 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)
/* 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;
}
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;
}
}
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;
}
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++) {
* 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;
}
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);
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);
/* 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;
}
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;
}
* 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 ();
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"));
}
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++) {
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;
}
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;
}
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)) {
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;
}
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);
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;
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;
}
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);
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;
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;
}
/* 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);
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;
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;
}
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;
}
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);
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\""),
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;
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;
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);
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;
}
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) {
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;
}
}
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;
}
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;
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;
}
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;
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;
}
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;
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
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;
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;
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;
}
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;
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;
}
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;
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;
}
{
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;
}
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;
}
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);
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);
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;
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;
}
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);
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);
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) {
}
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;
}
}
*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);
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;
}
}
*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);
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);
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");
_("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;
}
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;
}
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);
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
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;
}
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");
}
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;
}
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;
}
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;
}
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);
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 = "";
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;
}
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) {
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;
}
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);
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;
}
@comp:
@comps:
+@const gchar *tzid, gconstpointer custom, GError **error:
@const gchar *tzid, gconstpointer custom, GError **error:
@custom:
@error:
</para>
-@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:
<!-- ##### FUNCTION camel_certdb_lock ##### -->
<para>
@gpointer cert_data:
@gpointer cert_data:
@gpointer cert_data:
+@gpointer cert_data:
+@gpointer cert_data:
+@gpointer cert_data:
+@gpointer cert_data:
@gpointer cert_data:
</para>
-@CDW_STREAM_LOCK:
+@CAMEL_DATA_WRAPPER_STREAM_LOCK:
<!-- ##### FUNCTION camel_data_wrapper_lock ##### -->
<para>
</para>
-@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:
<!-- ##### FUNCTION camel_folder_summary_lock ##### -->
<para>
</para>
-@CF_CHANGE_LOCK:
-@CF_REC_LOCK:
+@CAMEL_FOLDER_CHANGE_LOCK:
+@CAMEL_FOLDER_REC_LOCK:
<!-- ##### FUNCTION camel_folder_lock ##### -->
<para>
</para>
-@CS_REC_CONNECT_LOCK:
-@CS_CONNECT_OP_LOCK:
+@CAMEL_SERVICE_REC_CONNECT_LOCK:
+@CAMEL_SERVICE_CONNECT_OP_LOCK:
<!-- ##### FUNCTION camel_service_lock ##### -->
<para>
</para>
-@CS_SESSION_LOCK:
-@CS_THREAD_LOCK:
+@CAMEL_SESSION_SESSION_LOCK:
+@CAMEL_SESSION_THREAD_LOCK:
<!-- ##### FUNCTION camel_session_lock ##### -->
<para>
</para>
-@CSS_SUMMARY_LOCK:
-@CSS_IO_LOCK:
-@CSS_REF_LOCK:
+@CAMEL_STORE_SUMMARY_SUMMARY_LOCK:
+@CAMEL_STORE_SUMMARY_IO_LOCK:
+@CAMEL_STORE_SUMMARY_REF_LOCK:
<!-- ##### FUNCTION camel_store_summary_lock ##### -->
<para>
</para>
-@CS_FOLDER_LOCK:
+@CAMEL_STORE_FOLDER_LOCK:
<!-- ##### FUNCTION camel_store_lock ##### -->
<para>
</para>
-@CT_SEND_LOCK:
+@CAMEL_TRANSPORT_SEND_LOCK:
<!-- ##### FUNCTION camel_transport_lock ##### -->
<para>
</para>
-@CVF_SUMMARY_LOCK:
-@CVF_SUBFOLDER_LOCK:
-@CVF_CHANGED_LOCK:
+@CAMEL_VEE_FOLDER_SUMMARY_LOCK:
+@CAMEL_VEE_FOLDER_SUBFOLDER_LOCK:
+@CAMEL_VEE_FOLDER_CHANGED_LOCK:
<!-- ##### FUNCTION camel_vee_folder_lock ##### -->
<para>