From 5ec3dcdd5d0ae4fb057667b3f55432cc06a54da8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Apr 2004 22:43:06 +0000 Subject: [PATCH] gst/schedulers/gstbasicscheduler.c: make sure we can switch back to the main function if we're still in the main func... Original commit message from CVS: * gst/schedulers/gstbasicscheduler.c: make sure we can switch back to the main function if we're still in the main function (supposed to fix #139617) * gst/schedulers/gthread-cothreads.h: don't throw an error when switching to the same cothread --- ChangeLog | 8 ++++++++ gst/schedulers/gstbasicscheduler.c | 2 +- gst/schedulers/gthread-cothreads.h | 4 +--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90616d55fd..4a761bc619 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-04-10 Benjamin Otte + + * gst/schedulers/gstbasicscheduler.c: + make sure we can switch back to the main function if we're still in + the main function (supposed to fix #139617) + * gst/schedulers/gthread-cothreads.h: + don't throw an error when switching to the same cothread + 2004-04-09 Benjamin Otte * gst/gstbin.c: (gst_bin_get_type): diff --git a/gst/schedulers/gstbasicscheduler.c b/gst/schedulers/gstbasicscheduler.c index 42ffec6047..d221a86fe6 100644 --- a/gst/schedulers/gstbasicscheduler.c +++ b/gst/schedulers/gstbasicscheduler.c @@ -165,7 +165,7 @@ static GstSchedulerClass *parent_class = NULL; GstElement *current = ((GstBasicScheduler*)sched)->current; \ if (current && current->post_run_func) \ current->post_run_func (current); \ - SCHED (current)->current = NULL; \ + ((GstBasicScheduler*) sched)->current = NULL; \ do_cothread_switch \ (do_cothread_get_main \ (((GstBasicScheduler*)sched)->context)); \ diff --git a/gst/schedulers/gthread-cothreads.h b/gst/schedulers/gthread-cothreads.h index 63b255e640..df4524bee4 100644 --- a/gst/schedulers/gthread-cothreads.h +++ b/gst/schedulers/gthread-cothreads.h @@ -174,9 +174,7 @@ static void do_cothread_switch (cothread *to) { cothread *self = do_cothread_get_current(to->context); - if (self == to) { - g_warning ("trying to switch to the same cothread, not allowed"); - } else { + if (self != to) { self->context->current = to; g_cond_signal (to->cond); g_cond_wait (self->cond, self->context->mutex);