aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-summary.c
diff options
context:
space:
mode:
author4 <NotZed@Ximian.com>2001-12-01 05:38:05 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-12-01 05:38:05 +0800
commitaa0a82422beb72bc47b51c8d1e8cc8e95bf8250a (patch)
treec5cd5b7e469ffa9d8c9a6e58cbb77eab4614a4f2 /camel/camel-folder-summary.c
parent90299ffcbae59222348f2a14a04b4be8f5d1df4a (diff)
downloadgsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.tar
gsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.tar.gz
gsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.tar.bz2
gsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.tar.lz
gsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.tar.xz
gsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.tar.zst
gsoc2013-evolution-aa0a82422beb72bc47b51c8d1e8cc8e95bf8250a.zip
Use the uid rather than vuid for unmatched. Also add the uid to unmatched
2001-11-14 <NotZed@Ximian.com> * camel-vee-folder.c (folder_changed_remove_uid): Use the uid rather than vuid for unmatched. Also add the uid to unmatched if it wasn't in the unmatched_uids table at all. (folder_changed_change): If checking for added, if the new ones dont match, then try to add them to unmatched. Fixes #6893. * camel-folder-summary.c (camel_folder_summary_index): Change lock order, always summary_lock before ref_lock. (camel_folder_summary_array): " (camel_folder_summary_uid): " (camel_folder_summary_remove_uid): " Fixes a deadlock. svn path=/trunk/; revision=14831
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r--camel/camel-folder-summary.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 8cc355b26c..2591e868ab 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -336,18 +336,17 @@ camel_folder_summary_index(CamelFolderSummary *s, int i)
{
CamelMessageInfo *info = NULL;
- CAMEL_SUMMARY_LOCK(s, ref_lock);
CAMEL_SUMMARY_LOCK(s, summary_lock);
+ CAMEL_SUMMARY_LOCK(s, ref_lock);
if (i<s->messages->len)
info = g_ptr_array_index(s->messages, i);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
if (info)
info->refcount++;
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
return info;
}
@@ -369,8 +368,8 @@ camel_folder_summary_array(CamelFolderSummary *s)
GPtrArray *res = g_ptr_array_new();
int i;
- CAMEL_SUMMARY_LOCK(s, ref_lock);
CAMEL_SUMMARY_LOCK(s, summary_lock);
+ CAMEL_SUMMARY_LOCK(s, ref_lock);
g_ptr_array_set_size(res, s->messages->len);
for (i=0;i<s->messages->len;i++) {
@@ -378,8 +377,8 @@ camel_folder_summary_array(CamelFolderSummary *s)
info->refcount++;
}
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
return res;
}
@@ -421,17 +420,16 @@ camel_folder_summary_uid(CamelFolderSummary *s, const char *uid)
{
CamelMessageInfo *info;
- CAMEL_SUMMARY_LOCK(s, ref_lock);
CAMEL_SUMMARY_LOCK(s, summary_lock);
+ CAMEL_SUMMARY_LOCK(s, ref_lock);
info = g_hash_table_lookup(s->messages_uid, uid);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
if (info)
info->refcount++;
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
return info;
}
@@ -1062,18 +1060,18 @@ void camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
CamelMessageInfo *oldinfo;
char *olduid;
- CAMEL_SUMMARY_LOCK(s, ref_lock);
CAMEL_SUMMARY_LOCK(s, summary_lock);
+ CAMEL_SUMMARY_LOCK(s, ref_lock);
if (g_hash_table_lookup_extended(s->messages_uid, uid, (void *)&olduid, (void *)&oldinfo)) {
/* make sure it doesn't vanish while we're removing it */
oldinfo->refcount++;
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
camel_folder_summary_remove(s, oldinfo);
camel_folder_summary_info_free(s, oldinfo);
} else {
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
}
}