From a2db8a30c8e384371c37c7396246505aa54fb58e Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 4 Oct 2002 03:00:23 +0000 Subject: Dont get the filter driver inside the change_lock. Its not necessary, and 2002-10-03 Not Zed * camel-folder.c (folder_changed): Dont get the filter driver inside the change_lock. Its not necessary, and can cause deadlock with the way the mailer gets the filter driver via g_mainloop. Should fix #31572. svn path=/trunk/; revision=18321 --- camel/camel-folder.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'camel/camel-folder.c') diff --git a/camel/camel-folder.c b/camel/camel-folder.c index a374e1a8d5..8b121d5d75 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -1600,19 +1600,22 @@ folder_changed (CamelObject *obj, gpointer event_data) if (changed != NULL) { CamelSession *session = ((CamelService *)folder->parent_store)->session; - CamelFilterDriver *driver; + CamelFilterDriver *driver = NULL; - CAMEL_FOLDER_LOCK(folder, change_lock); if ((folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) - && changed->uid_recent->len>0 - && (driver = camel_session_get_filter_driver(session, "incoming", NULL))) { + && changed->uid_recent->len > 0) + driver = camel_session_get_filter_driver(session, "incoming", NULL); + + CAMEL_FOLDER_LOCK(folder, change_lock); + + if (driver) { #ifdef ENABLE_THREADS GPtrArray *recents = g_ptr_array_new(); int i; struct _folder_filter_msg *msg; d(printf("** Have '%d' recent messages, launching thread to process them\n", changed->uid_recent->len)); - + folder->priv->frozen++; msg = camel_session_thread_msg_new(session, &filter_ops, sizeof(*msg)); for (i=0;iuid_recent->len;i++) @@ -1636,6 +1639,7 @@ folder_changed (CamelObject *obj, gpointer event_data) thaw(), but thats a pita */ g_ptr_array_set_size(changed->uid_recent, 0); } + if (folder->priv->frozen) { camel_folder_change_info_cat(folder->priv->changed_frozen, changed); ret = FALSE; -- cgit