From: Wim T. <wt...@us...> - 2002-05-29 15:00:01
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: wtay Date: Wed May 29 2002 08:00:00 PDT Log message: Some cleanups, more debugging info Modified files: gst : cothreads.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/cothreads.c.diff?r1=1.63&r2=1.64 ====Begin Diffs==== Index: cothreads.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/cothreads.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- cothreads.c 19 Apr 2002 10:26:56 -0000 1.63 +++ cothreads.c 29 May 2002 14:59:48 -0000 1.64 @@ -33,6 +33,7 @@ #include "cothreads.h" #include "gstarch.h" #include "gstlog.h" +#include "gstutils.h" #define STACK_SIZE 0x200000 @@ -86,7 +87,7 @@ memset (ctx->threads, 0, sizeof (ctx->threads)); - ctx->threads[0] = (cothread_state *) g_malloc (sizeof (cothread_state)); + ctx->threads[0] = (cothread_state *) g_malloc0 (sizeof (cothread_state)); ctx->threads[0]->ctx = ctx; ctx->threads[0]->threadnum = 0; ctx->threads[0]->func = NULL; @@ -491,21 +492,22 @@ #endif enter = setjmp (current->jmp); if (enter != 0) { - GST_DEBUG (0, "enter thread #%d %d %p<->%p (%d)", current->threadnum, enter, - current->sp, current->top_sp, (char*)current->top_sp - (char*)current->sp); + GST_DEBUG (0, "enter thread #%d %d %p<->%p (%d) %p", current->threadnum, enter, + current->sp, current->top_sp, (char*)current->top_sp - (char*)current->sp, current->jmp); return; } - GST_DEBUG (0, "exit thread #%d %d %p<->%p (%d)", current->threadnum, enter, - current->sp, current->top_sp, (char*)current->top_sp - (char*)current->sp); + GST_DEBUG (0, "exit thread #%d %d %p<->%p (%d) %p", current->threadnum, enter, + current->sp, current->top_sp, (char*)current->top_sp - (char*)current->sp, current->jmp); enter = 1; - if (current->flags & COTHREAD_DESTROYED) + if (current->flags & COTHREAD_DESTROYED) { cothread_destroy (current); + } GST_DEBUG (0, "set stack to %p", thread->sp); /* restore stack pointer and other stuff of new cothread */ if (thread->flags & COTHREAD_STARTED) { - GST_DEBUG (0, "in thread "); + GST_DEBUG (0, "in thread %p", thread->jmp); /* switch to it */ longjmp (thread->jmp, 1); } |