From 284014fed1eb3a2e890589ffb668f12e104b8f7b Mon Sep 17 00:00:00 2001 From: Erik Walthinsen Date: Fri, 19 Jan 2001 07:48:43 +0000 Subject: [PATCH] ALPHA COTHREADS WORK! Worked around a nasty stack issue that probably can't be solved anyway. Tomorrow the UDB buil... Original commit message from CVS: ALPHA COTHREADS WORK! Worked around a nasty stack issue that probably can't be solved anyway. Tomorrow the UDB build will commence, and let the best guess win! --- gst/cothreads.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/cothreads.c b/gst/cothreads.c index d3ea822c4c..f28db02ad9 100644 --- a/gst/cothreads.c +++ b/gst/cothreads.c @@ -173,14 +173,18 @@ cothread_stub (void) register cothread_state *thread = ctx->threads[ctx->current]; GST_DEBUG_ENTER(""); + thread->flags |= COTHREAD_STARTED; - if (thread->func) + while (1) { thread->func(thread->argc,thread->argv); + // we do this to avoid ever returning, we just switch to 0th thread + cothread_switch(cothread_main(ctx)); + } thread->flags &= ~COTHREAD_STARTED; thread->pc = 0; thread->sp = thread->top_sp; + fprintf(stderr,"uh, yeah, we shouldn't be here, but we should deal anyway\n"); GST_DEBUG_LEAVE(""); -// fprintf(stderr,"uh, yeah, we shouldn't be here, but we should deal anyway\n"); } /**