** BUGFIX: #583507 - Fix for evolution hang while updating search folder
authorSrinivasa Ragavan <sragavan@novell.com>
Thu, 11 Jun 2009 16:47:10 +0000 (22:17 +0530)
committerSrinivasa Ragavan <sragavan@novell.com>
Thu, 11 Jun 2009 18:45:09 +0000 (00:15 +0530)
* camel/camel-vee-folder.c: Hold the locks appropriately.

camel/camel-vee-folder.c

index 1b614a9..78748c6 100644 (file)
@@ -1533,12 +1533,14 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
        }
 
        CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
-       if (matches_changed || matches_added || changes->uid_removed->len||present)
-               camel_db_begin_transaction (folder->parent_store->cdb_w, NULL);
 
        if (folder_unmatched != NULL)
                CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
 
+       if (matches_changed || matches_added || changes->uid_removed->len||present)
+               camel_db_begin_transaction (folder->parent_store->cdb_w, NULL);
+
+
        dd(printf("Vfolder '%s' subfolder changed '%s'\n", folder->full_name, sub->full_name));
        dd(printf(" changed %u added %u removed %u\n", changes->uid_changed->len, changes->uid_added->len, changes->uid_removed->len));