Index: camel-maildir-summary.c
===================================================================
--- camel-maildir-summary.c	(revision 8389)
+++ camel-maildir-summary.c	(working copy)
@@ -72,6 +72,7 @@ struct _CamelMaildirSummaryPrivate {
 	char *hostname;
 
 	GHashTable *load_map;
+	GMutex *summary_lock;
 };
 
 static CamelLocalSummaryClass *parent_class;
@@ -138,6 +139,7 @@ camel_maildir_summary_init (CamelMaildir
 	} else {
 		o->priv->hostname = g_strdup("localhost");
 	}
+	o->priv->summary_lock = g_mutex_new ();
 }
 
 static void
@@ -146,6 +148,7 @@ camel_maildir_summary_finalise(CamelObje
 	CamelMaildirSummary *o = (CamelMaildirSummary *)obj;
 
 	g_free(o->priv->hostname);
+	g_mutex_free (o->priv->summary_lock);
 	g_free(o->priv);
 }
 
@@ -547,6 +550,8 @@ maildir_summary_check(CamelLocalSummary 
 	char *uid;
 	struct _remove_data rd = { cls, changes };
 
+	g_mutex_lock (((CamelMaildirSummary *) cls)->priv->summary_lock);
+
 	new = g_strdup_printf("%s/new", cls->folder_path);
 	cur = g_strdup_printf("%s/cur", cls->folder_path);
 
@@ -564,6 +569,7 @@ maildir_summary_check(CamelLocalSummary 
 		g_free(cur);
 		g_free(new);
 		camel_operation_end(NULL);
+		g_mutex_unlock (((CamelMaildirSummary *) cls)->priv->summary_lock);
 		return -1;
 	}
 
@@ -723,6 +729,8 @@ maildir_summary_check(CamelLocalSummary 
 	qsort(s->messages->pdata, s->messages->len, sizeof(CamelMessageInfo *), sort_receive_cmp);
 	CAMEL_SUMMARY_UNLOCK(s, summary_lock);
 
+	g_mutex_unlock (((CamelMaildirSummary *) cls)->priv->summary_lock);
+
 	return 0;
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 8403)
+++ ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2008-01-22  Srinivasa Ragavan  <sragavan@novell.com>
+
+	** Fix for bug #482940
+
+	* camel-maildir-summary.c: (camel_maildir_summary_init),
+	(camel_maildir_summary_finalise), (maildir_summary_check): Make the
+	maildir summary check thread safe. May be needed for other functions
+	too.
+
 2008-01-16  Sankar P  <psankar@novell.com>
 
 	* camel-mbox-summary.c: (mbox_summary_sync_quick),
