From 050631f63bc037ced6731310ef74d98d80560c50 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 20 Jul 2004 10:57:38 +0000 Subject: [PATCH] fix for #142813 - deadlock in opt Original commit message from CVS: fix for #142813 - deadlock in opt --- ChangeLog | 10 ++++++++++ gst/schedulers/gstoptimalscheduler.c | 11 ++++++++--- tests/old/testsuite/schedulers/Makefile.am | 9 ++++++--- testsuite/schedulers/Makefile.am | 9 ++++++--- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d62796..53b7784 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2004-07-20 Thomas Vander Stichele + patch by: David Moore + + * gst/schedulers/gstoptimalscheduler.c: (group_has_element), + (schedule_group), (gst_opt_scheduler_schedule_run_queue), + (group_migrate_connected): + * testsuite/schedulers/Makefile.am: + fix for #142813 (Deadlock in optimal scheduler) + +2004-07-20 Thomas Vander Stichele + patch by: Wim Taymans * gst/schedulers/gstoptimalscheduler.c: (group_has_element), diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index 92969bd..667adaa 100644 --- a/gst/schedulers/gstoptimalscheduler.c +++ b/gst/schedulers/gstoptimalscheduler.c @@ -1152,23 +1152,28 @@ schedule_group (GstOptSchedulerGroup * group) GST_INFO ("not scheduling group %p without schedulefunc", group); return FALSE; } else { - GSList *l; + GSList *l, *lcopy; - for (l = group->elements; l; l = l->next) { + lcopy = g_slist_copy (group->elements); + for (l = lcopy; l; l = l->next) { GstElement *e = (GstElement *) l->data; + gst_object_ref (GST_OBJECT (e)); if (e->pre_run_func) e->pre_run_func (e); } group->schedulefunc (group->argc, group->argv); - for (l = group->elements; l; l = l->next) { + for (l = lcopy; l; l = l->next) { GstElement *e = (GstElement *) l->data; if (e->post_run_func) e->post_run_func (e); + + gst_object_unref (GST_OBJECT (e)); } + g_slist_free (lcopy); } return TRUE; diff --git a/tests/old/testsuite/schedulers/Makefile.am b/tests/old/testsuite/schedulers/Makefile.am index 147b594..f14ccae 100644 --- a/tests/old/testsuite/schedulers/Makefile.am +++ b/tests/old/testsuite/schedulers/Makefile.am @@ -4,12 +4,15 @@ tests_pass = \ unlink_src unlink_sink \ relink_src relink_sink \ unref_src unref_sink \ - 143777 143777-2 147713 147819 147894 + 142183 142183-2 \ + 143777 143777-2 \ + 147713 \ + 147819 \ + 147894 # don't enable this one unless it actually works. # useless_iteration - -tests_fail = 142183 142183-2 +tests_fail = tests_ignore = unlink_src_SOURCES = unlink.c diff --git a/testsuite/schedulers/Makefile.am b/testsuite/schedulers/Makefile.am index 147b594..f14ccae 100644 --- a/testsuite/schedulers/Makefile.am +++ b/testsuite/schedulers/Makefile.am @@ -4,12 +4,15 @@ tests_pass = \ unlink_src unlink_sink \ relink_src relink_sink \ unref_src unref_sink \ - 143777 143777-2 147713 147819 147894 + 142183 142183-2 \ + 143777 143777-2 \ + 147713 \ + 147819 \ + 147894 # don't enable this one unless it actually works. # useless_iteration - -tests_fail = 142183 142183-2 +tests_fail = tests_ignore = unlink_src_SOURCES = unlink.c -- 2.7.4