fix for #142813 - deadlock in opt
authorThomas Vander Stichele <thomas@apestaart.org>
Tue, 20 Jul 2004 10:57:38 +0000 (10:57 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Tue, 20 Jul 2004 10:57:38 +0000 (10:57 +0000)
Original commit message from CVS:
fix for #142813 - deadlock in opt

ChangeLog
gst/schedulers/gstoptimalscheduler.c
tests/old/testsuite/schedulers/Makefile.am
testsuite/schedulers/Makefile.am

index 5d62796..53b7784 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 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
 
        * gst/schedulers/gstoptimalscheduler.c: (group_has_element),
index 92969bd..667adaa 100644 (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;
index 147b594..f14ccae 100644 (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
index 147b594..f14ccae 100644 (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