Error checking in pthread creation more info in gst_util_dump_mem

Original commit message from CVS:
Error checking in pthread creation
more info in gst_util_dump_mem
This commit is contained in:
Wim Taymans 2002-05-29 15:01:50 +00:00
parent e4637a0a82
commit fddb92b5e2
2 changed files with 18 additions and 2 deletions

View file

@ -271,7 +271,11 @@ gst_thread_change_state (GstElement * element)
g_mutex_lock (thread->lock);
/* create the thread */
pthread_create (&thread->thread_id, NULL, gst_thread_main_loop, thread);
if (pthread_create (&thread->thread_id, NULL, gst_thread_main_loop, thread) != 0) {
g_mutex_unlock (thread->lock);
THR_DEBUG ("could not create thread \"%s\"", GST_ELEMENT_NAME (element));
return GST_STATE_FAILURE;
}
/* wait for it to 'spin up' */
THR_DEBUG ("waiting for child thread spinup");

View file

@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "gst_private.h"
#include "gstutils.h"
@ -213,7 +214,18 @@ gst_util_dump_mem (guchar * mem, guint size)
i = j = 0;
while (i < size) {
if (j == 0) {
g_print ("\n%08x : ", i);
if (i != 0) {
guint k;
for (k = i - 16; k < i; k++) {
if (isprint (mem[k]))
g_print ("%c", mem[k]);
else
g_print (".");
}
g_print ("\n");
}
g_print ("%08x : ", i);
j = 15;
}
else {