From: Thomas Vander Stichele Date: Tue, 20 Jul 2004 10:57:38 +0000 (+0000) Subject: fix for #142813 - deadlock in opt X-Git-Tag: RELEASE-0_8_4~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=050631f63bc037ced6731310ef74d98d80560c50;p=platform%2Fupstream%2Fgstreamer.git fix for #142813 - deadlock in opt Original commit message from CVS: fix for #142813 - deadlock in opt --- diff --git a/ChangeLog b/ChangeLog index 5d627963ec..53b7784aad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +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 diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index 92969bdcd9..667adaa7d7 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 147b59446a..f14ccae6ae 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 147b59446a..f14ccae6ae 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