Blame SOURCES/dleyna-core-Make-the-task-processor-more-robust.patch

f8f92e
From 48d5213ad10278a3e419b66e4bc3c678254a3c34 Mon Sep 17 00:00:00 2001
f8f92e
From: Debarshi Ray <debarshir@freedesktop.org>
f8f92e
Date: Fri, 4 Dec 2020 14:47:13 +0100
f8f92e
Subject: [PATCH 1/2] Remove any pending task processing handlers when
f8f92e
 destroying a queue
f8f92e
f8f92e
https://github.com/phako/dleyna-core/pull/2
f8f92e
---
f8f92e
 libdleyna/core/task-processor.c | 5 +++++
f8f92e
 1 file changed, 5 insertions(+)
f8f92e
f8f92e
diff --git a/libdleyna/core/task-processor.c b/libdleyna/core/task-processor.c
f8f92e
index f50dd569ed61..8065a205c061 100644
f8f92e
--- a/libdleyna/core/task-processor.c
f8f92e
+++ b/libdleyna/core/task-processor.c
f8f92e
@@ -96,6 +96,11 @@ static void prv_free_cb(gpointer data)
f8f92e
 
f8f92e
 	DLEYNA_LOG_DEBUG("Enter");
f8f92e
 
f8f92e
+	if (task_queue->idle_id) {
f8f92e
+		g_source_remove(task_queue->idle_id);
f8f92e
+		task_queue->idle_id = 0;
f8f92e
+	}
f8f92e
+
f8f92e
 	g_ptr_array_foreach(task_queue->tasks, prv_task_free_cb, task_queue);
f8f92e
 	g_ptr_array_unref(task_queue->tasks);
f8f92e
 
f8f92e
-- 
f8f92e
2.28.0
f8f92e
f8f92e
f8f92e
From 00c959020de6bfdccace493703dfcdd45d74d479 Mon Sep 17 00:00:00 2001
f8f92e
From: Debarshi Ray <debarshir@freedesktop.org>
f8f92e
Date: Fri, 4 Dec 2020 20:24:20 +0100
f8f92e
Subject: [PATCH 2/2] Remove queues only if dleyna_task_processor_t->on_quit_cb
f8f92e
 is scheduled
f8f92e
f8f92e
See commit 1de3325c201dc0e1 for the original reason why all the queues
f8f92e
need to be removed before dleyna_task_processor_t->on_quit_cb is run.
f8f92e
However, if we remove them too early then there might still be tasks
f8f92e
in flight that need to use them.
f8f92e
f8f92e
https://bugzilla.redhat.com/show_bug.cgi?id=1890618
f8f92e
https://github.com/phako/dleyna-core/pull/2
f8f92e
---
f8f92e
 libdleyna/core/task-processor.c | 8 ++++----
f8f92e
 1 file changed, 4 insertions(+), 4 deletions(-)
f8f92e
f8f92e
diff --git a/libdleyna/core/task-processor.c b/libdleyna/core/task-processor.c
f8f92e
index 8065a205c061..14972303c307 100644
f8f92e
--- a/libdleyna/core/task-processor.c
f8f92e
+++ b/libdleyna/core/task-processor.c
f8f92e
@@ -257,12 +257,12 @@ void dleyna_task_processor_set_quitting(dleyna_task_processor_t *processor)
f8f92e
 	DLEYNA_LOG_DEBUG("Enter");
f8f92e
 
f8f92e
 	processor->quitting = TRUE;
f8f92e
+	prv_cancel_all_queues(processor);
f8f92e
 
f8f92e
-	if (processor->running_tasks == 0)
f8f92e
+	if (processor->running_tasks == 0) {
f8f92e
 		g_idle_add(processor->on_quit_cb, NULL);
f8f92e
-
f8f92e
-	prv_cancel_all_queues(processor);
f8f92e
-	g_hash_table_remove_all(processor->task_queues);
f8f92e
+		g_hash_table_remove_all(processor->task_queues);
f8f92e
+	}
f8f92e
 
f8f92e
 	DLEYNA_LOG_DEBUG("Exit");
f8f92e
 }
f8f92e
-- 
f8f92e
2.28.0
f8f92e