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:
parent
8139aeca9e
commit
7dcd7a13a1
@ -87,8 +87,6 @@ noinst_HEADERS = \
|
|||||||
gsti386.h \
|
gsti386.h \
|
||||||
gstppc.h
|
gstppc.h
|
||||||
|
|
||||||
CFLAGS += -g -O6 -Wall
|
|
||||||
|
|
||||||
libgst_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(XML_LIBS)
|
libgst_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(XML_LIBS)
|
||||||
libgst_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
libgst_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
||||||
|
|
||||||
|
@ -55,15 +55,16 @@ cothread_create (cothread_context *ctx)
|
|||||||
//if (0) {
|
//if (0) {
|
||||||
if (pthread_self() == 0) {
|
if (pthread_self() == 0) {
|
||||||
s = (cothread_state *)malloc(sizeof(int) * COTHREAD_STACKSIZE);
|
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 {
|
} else {
|
||||||
char *sp = CURRENT_STACK_FRAME;
|
char *sp = CURRENT_STACK_FRAME;
|
||||||
unsigned long *stack_end = (unsigned long *)((unsigned long)sp &
|
unsigned long *stack_end = (unsigned long *)((unsigned long)sp &
|
||||||
~(STACK_SIZE - 1));
|
~(STACK_SIZE - 1));
|
||||||
s = (cothread_state *)(stack_end + ((ctx->nthreads - 1) *
|
s = (cothread_state *)(stack_end + ((ctx->nthreads - 1) *
|
||||||
COTHREAD_STACKSIZE));
|
COTHREAD_STACKSIZE));
|
||||||
|
DEBUG("new stack (case 2) at %p\n",s);
|
||||||
if (mmap((char *)s,COTHREAD_STACKSIZE*(sizeof(int)),
|
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) {
|
-1,0) < 0) {
|
||||||
perror("mmap'ing cothread stack space");
|
perror("mmap'ing cothread stack space");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -136,7 +137,7 @@ cothread_init (void)
|
|||||||
ctx->threads[0]->sp = (int *)CURRENT_STACK_FRAME;
|
ctx->threads[0]->sp = (int *)CURRENT_STACK_FRAME;
|
||||||
ctx->threads[0]->pc = 0;
|
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
|
// we consider the initiating process to be cothread 0
|
||||||
ctx->nthreads = 1;
|
ctx->nthreads = 1;
|
||||||
|
@ -42,7 +42,5 @@ noinst_HEADERS = \
|
|||||||
gsttypefind.h \
|
gsttypefind.h \
|
||||||
gstsinesrc.h
|
gstsinesrc.h
|
||||||
|
|
||||||
CFLAGS += -O2 -Wall
|
|
||||||
|
|
||||||
libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS)
|
libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS)
|
||||||
libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
||||||
|
@ -113,7 +113,7 @@ gst_pipeline_init (GstPipeline *pipeline)
|
|||||||
GstElement*
|
GstElement*
|
||||||
gst_pipeline_new (guchar *name)
|
gst_pipeline_new (guchar *name)
|
||||||
{
|
{
|
||||||
return gst_elementfactory_make ("bin", name);
|
return gst_elementfactory_make ("pipeline", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -309,7 +309,7 @@ gst_thread_main_loop (void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GST_FLAG_UNSET (thread, GST_THREAD_STATE_REAPING);
|
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_info("gstthread: thread \"%s\" is stopped\n",
|
||||||
gst_element_get_name (GST_ELEMENT (thread)));
|
gst_element_get_name (GST_ELEMENT (thread)));
|
||||||
|
@ -8,7 +8,5 @@ libgsttypes_la_SOURCES = \
|
|||||||
|
|
||||||
#noinst_HEADERS =
|
#noinst_HEADERS =
|
||||||
|
|
||||||
CFLAGS += -O2 -Wall
|
|
||||||
|
|
||||||
libgsttypes_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS)
|
libgsttypes_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS)
|
||||||
libgsttypes_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
libgsttypes_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
||||||
|
@ -42,7 +42,5 @@ noinst_HEADERS = \
|
|||||||
gsttypefind.h \
|
gsttypefind.h \
|
||||||
gstsinesrc.h
|
gstsinesrc.h
|
||||||
|
|
||||||
CFLAGS += -O2 -Wall
|
|
||||||
|
|
||||||
libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS)
|
libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS)
|
||||||
libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user