From 816d869e701164cbb1cee524b1ed39b4f61f05ca Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 24 Jul 2002 02:33:26 +0000 Subject: Duplicated the very much hack in imap_store_refresh_folders() to avoid a 2002-07-24 Not Zed * providers/imap/camel-imap-store.c (get_folder_info_online): Duplicated the very much hack in imap_store_refresh_folders() to avoid a deadlock in #27959. A decent fix has to wait for a rewrite. svn path=/trunk/; revision=17560 --- camel/ChangeLog | 7 +++++++ camel/providers/imap/camel-imap-store.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 985dda6efe..0f7299b4a2 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2002-07-24 Not Zed + + * providers/imap/camel-imap-store.c (get_folder_info_online): + Duplicated the very much hack in imap_store_refresh_folders() to + avoid a deadlock in #27959. A decent fix has to wait for a + rewrite. + 2002-07-23 Jeffrey Stedfast * camel-tcp-stream.c: #include for memcpy. diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index fbc6c39b31..2065b53007 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -767,6 +767,7 @@ copy_folder(char *key, CamelFolder *folder, GPtrArray *out) /* the alternative is to: make the camel folder->lock recursive (which should probably be done) or remove it from camel_folder_refresh_info, and use another locking mechanism */ +/* also see get_folder_info_online() for the same hack repeated */ static void imap_store_refresh_folders (CamelImapStore *store, CamelException *ex) { @@ -2013,7 +2014,9 @@ get_folder_info_online (CamelStore *store, const char *top, */ if (imap_store->current_folder && !strcmp (imap_store->current_folder->full_name, fi->full_name)) { - camel_folder_refresh_info (imap_store->current_folder, NULL); + /* we bypass the folder locking otherwise we can deadlock. we use the command lock for + any operations anyway so this is 'safe'. See comment above imap_store_refresh_folders() for info */ + CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(imap_store->current_folder))->refresh_info(imap_store->current_folder, ex); fi->unread_message_count = camel_folder_get_unread_message_count (imap_store->current_folder); } else fi->unread_message_count = get_folder_status (imap_store, fi->full_name, "UNSEEN"); -- cgit v1.2.3