Mostly minor little changes, but two interesting things: 1) removed a pthread_join from the gst_thread_main_loop. co...

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.
This commit is contained in:
Erik Walthinsen 2000-12-27 03:13:20 +00:00
parent 8139aeca9e
commit 7dcd7a13a1
7 changed files with 6 additions and 13 deletions

View 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)

View 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;

View 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)

View 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

View 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)));

View 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)

View 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)