From b423eeb18c3f8201cd0fc25dd0805a4baa69a595 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 10 Dec 2002 03:48:15 +0000 Subject: [PATCH] Added thread-loval variable for cothread index. Original commit message from CVS: Added thread-loval variable for cothread index. --- gst/gstinfo.c | 6 ++++-- gst/gstinfo.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/gstinfo.c b/gst/gstinfo.c index d7cd5b5..d79d753 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -50,6 +50,8 @@ int dladdr(void *address, Dl_info *dl) extern gchar *_gst_progname; +GStaticPrivate _gst_debug_cothread_index = G_STATIC_PRIVATE_INIT; + /***** Categories and colorization *****/ /* be careful with these, make them match the enum */ @@ -193,7 +195,7 @@ gst_default_debug_handler (gint category, gboolean incore, gchar *empty = ""; gchar *elementname = empty,*location = empty; int pid = getpid(); - int cothread_id = 0; /*FIXME*/ + int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index); #ifdef GST_DEBUG_COLOR int pid_color = pid%6 + 31; int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31); @@ -305,7 +307,7 @@ gst_default_info_handler (gint category, gboolean incore, gchar *empty = ""; gchar *elementname = empty,*location = empty; int pid = getpid(); - int cothread_id = 0; /*FIXME*/ + int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index); #ifdef GST_DEBUG_COLOR int pid_color = pid%6 + 31; int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31); diff --git a/gst/gstinfo.h b/gst/gstinfo.h index 6382402..5ff8f90 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -95,6 +95,7 @@ enum { extern const gchar *_gst_category_colors[32]; +extern GStaticPrivate _gst_debug_cothread_index; /********************************************************************** -- 2.7.4