mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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
This commit is contained in:
parent
3147797afb
commit
5ec3dcdd5d
3 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-04-10 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
|
* 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 <otte@gnome.org>
|
2004-04-09 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* gst/gstbin.c: (gst_bin_get_type):
|
* gst/gstbin.c: (gst_bin_get_type):
|
||||||
|
|
|
@ -165,7 +165,7 @@ static GstSchedulerClass *parent_class = NULL;
|
||||||
GstElement *current = ((GstBasicScheduler*)sched)->current; \
|
GstElement *current = ((GstBasicScheduler*)sched)->current; \
|
||||||
if (current && current->post_run_func) \
|
if (current && current->post_run_func) \
|
||||||
current->post_run_func (current); \
|
current->post_run_func (current); \
|
||||||
SCHED (current)->current = NULL; \
|
((GstBasicScheduler*) sched)->current = NULL; \
|
||||||
do_cothread_switch \
|
do_cothread_switch \
|
||||||
(do_cothread_get_main \
|
(do_cothread_get_main \
|
||||||
(((GstBasicScheduler*)sched)->context)); \
|
(((GstBasicScheduler*)sched)->context)); \
|
||||||
|
|
|
@ -174,9 +174,7 @@ static void do_cothread_switch (cothread *to)
|
||||||
{
|
{
|
||||||
cothread *self = do_cothread_get_current(to->context);
|
cothread *self = do_cothread_get_current(to->context);
|
||||||
|
|
||||||
if (self == to) {
|
if (self != to) {
|
||||||
g_warning ("trying to switch to the same cothread, not allowed");
|
|
||||||
} else {
|
|
||||||
self->context->current = to;
|
self->context->current = to;
|
||||||
g_cond_signal (to->cond);
|
g_cond_signal (to->cond);
|
||||||
g_cond_wait (self->cond, self->context->mutex);
|
g_cond_wait (self->cond, self->context->mutex);
|
||||||
|
|
Loading…
Reference in a new issue