From 3cbdcff43de5d8a9c379c6f64b8f192b1532fffb Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 14 Jun 2002 21:51:18 +0000 Subject: Unlock the command_lock after each UID STORE command so that other 2002-06-14 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_sync_online): Unlock the command_lock after each UID STORE command so that other (probably more important) threads can send their requests. svn path=/trunk/; revision=17188 --- camel/providers/imap/camel-imap-folder.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 1855ce2e8b..813a82ee89 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -732,8 +732,8 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) want to unset the previously set flags.*/ unset = !(info->flags & CAMEL_IMAP_SERVER_FLAGS); - /* FIXME: since we don't know the previously set - flags, if unset is TRUE then just unset all the flags? */ + /* FIXME: since we don't know the previously set flags, + if unset is TRUE then just unset all the flags? */ flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags); /* Note: get_matching() uses UID_SET_LIMIT to limit @@ -771,10 +771,15 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) } g_ptr_array_free (matches, TRUE); - if (camel_exception_is_set (ex)) { - CAMEL_IMAP_STORE_UNLOCK (store, command_lock); + /* We unlock here so that other threads can have a chance to grab the command_lock */ + CAMEL_IMAP_STORE_UNLOCK (store, command_lock); + + /* check for an exception */ + if (camel_exception_is_set (ex)) return; - } + + /* Re-lock the command_lock */ + CAMEL_IMAP_STORE_LOCK (store, command_lock); } /* Save the summary */ -- cgit