aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-folder.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-20 01:57:04 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-20 01:57:04 +0800
commita2b972dbe497ad8fa4d8eeaef9e540b3b55a31c9 (patch)
tree223f91cbac3eba13fa8178334d91df34942ca890 /camel/providers/imap/camel-imap-folder.c
parent75705d57f328f4ad10ad47692024a5c4de89dbc7 (diff)
downloadgsoc2013-evolution-a2b972dbe497ad8fa4d8eeaef9e540b3b55a31c9.tar.gz
gsoc2013-evolution-a2b972dbe497ad8fa4d8eeaef9e540b3b55a31c9.tar.zst
gsoc2013-evolution-a2b972dbe497ad8fa4d8eeaef9e540b3b55a31c9.zip
Make sure we hold the command_lock before accessing current_folder.
2002-06-19 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_refresh_info): Make sure we hold the command_lock before accessing current_folder. (imap_append_online): Same. (imap_transfer_online): Same. * providers/imap/camel-imap-store.c (delete_folder): We need to hold the command_lock before we can set the current_folder to NULL. (rename_folder): Same. (get_folder_info_online): We need to make sure we hold the command_lock in order to use current_folder. (everywhere): Same. svn path=/trunk/; revision=17233
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r--camel/providers/imap/camel-imap-folder.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 813a82ee89..6895a6bf0b 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -471,12 +471,15 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex)
/* If the folder isn't selected, select it (which will force
* a rescan if one is needed.
*/
+ CAMEL_IMAP_STORE_LOCK (imap_store, command_lock);
if (imap_store->current_folder != folder) {
+ CAMEL_IMAP_STORE_UNLOCK (imap_store, command_lock);
response = camel_imap_command (imap_store, folder, ex, NULL);
camel_imap_response_free (imap_store, response);
return;
}
-
+ CAMEL_IMAP_STORE_UNLOCK (imap_store, command_lock);
+
/* Otherwise, if we need a rescan, do it, and if not, just do
* a NOOP to give the server a chance to tell us about new
* messages.
@@ -1156,9 +1159,11 @@ imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
camel_imap_response_free (store, response);
/* Make sure a "folder_changed" is emitted. */
+ CAMEL_IMAP_STORE_LOCK (store, command_lock);
if (store->current_folder != folder ||
camel_folder_summary_count (folder->summary) == count)
imap_refresh_info (folder, ex);
+ CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
}
static void
@@ -1360,10 +1365,12 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
return;
/* Make the destination notice its new messages */
+ CAMEL_IMAP_STORE_LOCK (store, command_lock);
if (store->current_folder != dest ||
camel_folder_summary_count (dest->summary) == count)
camel_folder_refresh_info (dest, ex);
-
+ CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
+
if (delete_originals) {
for (i = 0; i < uids->len; i++)
camel_folder_delete_message (source, uids->pdata[i]);