Mostly minor little changes, but two interesting things: 1) removed a pthread_join...
authorErik Walthinsen <omega@temple-baptist.org>
Wed, 27 Dec 2000 03:13:20 +0000 (03:13 +0000)
committerErik Walthinsen <omega@temple-baptist.org>
Wed, 27 Dec 2000 03:13:20 +0000 (03:13 +0000)
Original commit message from CVS:
Mostly minor little changes, but two interesting things:

1) removed a pthread_join from the gst_thread_main_loop.  commented out
because the thread isn't supposed to run pthread_join, the main process is.

2) Fixed a major bug with cothreads in threads.  Had to add MAP_FIXED to
the mmap() of the cothread stack.  Presumably the gilbc that ships with
redhat 7.0 now places these mmap requests somewhat randomly.  Since they
*must* be exactly where we expect them, it was failing.  MAP_FIXED forces
it to put it where we say.

gst/Makefile.am
gst/cothreads.c
gst/elements/Makefile.am
gst/gstpipeline.c
gst/gstthread.c
gst/types/Makefile.am
plugins/elements/Makefile.am

index 2fe397f..e64ac09 100644 (file)
@@ -87,8 +87,6 @@ noinst_HEADERS =      \
        gsti386.h       \
        gstppc.h        
 
-CFLAGS += -g -O6 -Wall 
-
 libgst_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(XML_LIBS)
 libgst_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
 
index a60d858..211d655 100644 (file)
@@ -55,15 +55,16 @@ cothread_create (cothread_context *ctx)
   //if (0) {
   if (pthread_self() == 0) {
     s = (cothread_state *)malloc(sizeof(int) * COTHREAD_STACKSIZE);
-    DEBUG("new stack at %p\n",s);
+    DEBUG("new stack (case 1) at %p\n",s);
   } else {
     char *sp = CURRENT_STACK_FRAME;
     unsigned long *stack_end = (unsigned long *)((unsigned long)sp &
       ~(STACK_SIZE - 1));
     s = (cothread_state *)(stack_end + ((ctx->nthreads - 1) *
                            COTHREAD_STACKSIZE));
+    DEBUG("new stack (case 2) at %p\n",s);
     if (mmap((char *)s,COTHREAD_STACKSIZE*(sizeof(int)),
-             PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_ANONYMOUS,
+             PROT_READ|PROT_WRITE|PROT_EXEC,MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS,
              -1,0) < 0) {
       perror("mmap'ing cothread stack space");
       return NULL;
@@ -136,7 +137,7 @@ cothread_init (void)
   ctx->threads[0]->sp = (int *)CURRENT_STACK_FRAME;
   ctx->threads[0]->pc = 0;
 
-  DEBUG("0th thread is at %p %p\n",ctx->threads[0], ctx->threads[0]->sp);
+  DEBUG("0th thread is at %p, sp %p\n",ctx->threads[0], ctx->threads[0]->sp);
 
   // we consider the initiating process to be cothread 0
   ctx->nthreads = 1;
index bf57b27..ac3b284 100644 (file)
@@ -42,7 +42,5 @@ noinst_HEADERS =              \
        gsttypefind.h           \
        gstsinesrc.h
 
-CFLAGS += -O2 -Wall 
-
 libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS)
 libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
index dbcdb22..cf5ea6f 100644 (file)
@@ -113,7 +113,7 @@ gst_pipeline_init (GstPipeline *pipeline)
 GstElement*
 gst_pipeline_new (guchar *name) 
 {
-  return gst_elementfactory_make ("bin", name);
+  return gst_elementfactory_make ("pipeline", name);
 }
 
 static void 
index 73561d3..b419743 100644 (file)
@@ -309,7 +309,7 @@ gst_thread_main_loop (void *arg)
   }
 
   GST_FLAG_UNSET (thread, GST_THREAD_STATE_REAPING);
-  pthread_join (thread->thread_id, 0);
+//  pthread_join (thread->thread_id, 0);
 
   gst_info("gstthread: thread \"%s\" is stopped\n",
                  gst_element_get_name (GST_ELEMENT (thread)));
index ff77ccc..3792906 100644 (file)
@@ -8,7 +8,5 @@ libgsttypes_la_SOURCES =        \
 
 #noinst_HEADERS =
 
-CFLAGS += -O2 -Wall
-
 libgsttypes_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) 
 libgsttypes_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
index bf57b27..ac3b284 100644 (file)
@@ -42,7 +42,5 @@ noinst_HEADERS =              \
        gsttypefind.h           \
        gstsinesrc.h
 
-CFLAGS += -O2 -Wall 
-
 libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS)
 libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)