[evolution] Bug 686813 - ECaldavChooser: Deadlock on cancellation



commit e7981244a68c9d0b6b93d8c2697569668098b647
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Oct 25 08:04:19 2012 -0400

    Bug 686813 - ECaldavChooser: Deadlock on cancellation

 modules/cal-config-caldav/e-caldav-chooser.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/modules/cal-config-caldav/e-caldav-chooser.c b/modules/cal-config-caldav/e-caldav-chooser.c
index b4c51a9..30aa8ff 100644
--- a/modules/cal-config-caldav/e-caldav-chooser.c
+++ b/modules/cal-config-caldav/e-caldav-chooser.c
@@ -940,9 +940,14 @@ caldav_chooser_calendar_home_set_cb (SoupSession *session,
 
 	doc = caldav_chooser_parse_xml (message, "multistatus", &error);
 
+	/* If we were cancelled then we're in a GCancellable::cancelled
+	 * signal handler right now and GCancellable has its mutex locked,
+	 * which means calling g_cancellable_disconnect() now will deadlock
+	 * when it too tries to acquire the mutex.  So defer the GAsyncResult
+	 * completion to an idle callback to avoid this deadlock. */
 	if (error != NULL) {
 		g_simple_async_result_set_from_error (simple, error);
-		g_simple_async_result_complete (simple);
+		g_simple_async_result_complete_in_idle (simple);
 		g_object_unref (simple);
 		g_error_free (error);
 		return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]