fix for #142813 - deadlock in opt

Original commit message from CVS:
fix for #142813 - deadlock in opt
This commit is contained in:
Thomas Vander Stichele 2004-07-20 10:57:38 +00:00
parent add97dd1ce
commit 050631f63b
4 changed files with 30 additions and 9 deletions

View file

@ -1,3 +1,13 @@
2004-07-20 Thomas Vander Stichele <thomas at apestaart dot org>
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 <thomas at apestaart dot org>
patch by: Wim Taymans

View file

@ -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;

View file

@ -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

View file

@ -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