mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 09:25:42 +00:00
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:
parent
e4637a0a82
commit
fddb92b5e2
2 changed files with 18 additions and 2 deletions
|
@ -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");
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue