Blame SOURCES/evolution-data-server-3.22.7-deadlock-categories-finalize.patch
|
|
a9434d |
diff -up evolution-data-server-3.22.7/libedataserver/e-categories.c.deadlock-categories-finalize evolution-data-server-3.22.7/libedataserver/e-categories.c
|
|
|
a9434d |
--- evolution-data-server-3.22.7/libedataserver/e-categories.c.deadlock-categories-finalize 2017-03-20 10:07:46.000000000 +0100
|
|
|
a9434d |
+++ evolution-data-server-3.22.7/libedataserver/e-categories.c 2017-10-19 17:44:13.306338284 +0200
|
|
|
a9434d |
@@ -224,8 +224,9 @@ hash_to_xml_string (gpointer key,
|
|
|
a9434d |
g_string_append_len (string, "/>\n", 3);
|
|
|
a9434d |
}
|
|
|
a9434d |
|
|
|
a9434d |
-static gboolean
|
|
|
a9434d |
-idle_saver_cb (gpointer user_data)
|
|
|
a9434d |
+/* Called with the @categories lock locked */
|
|
|
a9434d |
+static void
|
|
|
a9434d |
+idle_saver_save (void)
|
|
|
a9434d |
{
|
|
|
a9434d |
GString *buffer;
|
|
|
a9434d |
gchar *contents;
|
|
|
a9434d |
@@ -234,8 +235,6 @@ idle_saver_cb (gpointer user_data)
|
|
|
a9434d |
EChangedListener *emit_listeners = NULL; /* owned */
|
|
|
a9434d |
GError *error = NULL;
|
|
|
a9434d |
|
|
|
a9434d |
- G_LOCK (categories);
|
|
|
a9434d |
-
|
|
|
a9434d |
if (!save_is_pending)
|
|
|
a9434d |
goto exit;
|
|
|
a9434d |
|
|
|
a9434d |
@@ -269,14 +268,26 @@ idle_saver_cb (gpointer user_data)
|
|
|
a9434d |
exit:
|
|
|
a9434d |
idle_id = 0;
|
|
|
a9434d |
|
|
|
a9434d |
- G_UNLOCK (categories);
|
|
|
a9434d |
-
|
|
|
a9434d |
/* Emit the signal with the lock released to avoid re-entrancy
|
|
|
a9434d |
* deadlocks. Hold a reference to @listeners until this is complete. */
|
|
|
a9434d |
if (emit_listeners) {
|
|
|
a9434d |
+ G_UNLOCK (categories);
|
|
|
a9434d |
+
|
|
|
a9434d |
g_signal_emit_by_name (emit_listeners, "changed");
|
|
|
a9434d |
g_object_unref (emit_listeners);
|
|
|
a9434d |
+
|
|
|
a9434d |
+ G_LOCK (categories);
|
|
|
a9434d |
}
|
|
|
a9434d |
+}
|
|
|
a9434d |
+
|
|
|
a9434d |
+static gboolean
|
|
|
a9434d |
+idle_saver_cb (gpointer user_data)
|
|
|
a9434d |
+{
|
|
|
a9434d |
+ G_LOCK (categories);
|
|
|
a9434d |
+
|
|
|
a9434d |
+ idle_saver_save ();
|
|
|
a9434d |
+
|
|
|
a9434d |
+ G_UNLOCK (categories);
|
|
|
a9434d |
|
|
|
a9434d |
return FALSE;
|
|
|
a9434d |
}
|
|
|
a9434d |
@@ -462,7 +473,7 @@ finalize_categories (void)
|
|
|
a9434d |
G_LOCK (categories);
|
|
|
a9434d |
|
|
|
a9434d |
if (save_is_pending)
|
|
|
a9434d |
- idle_saver_cb (NULL);
|
|
|
a9434d |
+ idle_saver_save ();
|
|
|
a9434d |
|
|
|
a9434d |
if (idle_id > 0) {
|
|
|
a9434d |
g_source_remove (idle_id);
|