diff -r 71e347f905f2 -r 4a7fac7dd34a gstreamer_core/gst/gsttrace.h --- a/gstreamer_core/gst/gsttrace.h Fri Mar 19 09:35:09 2010 +0200 +++ b/gstreamer_core/gst/gsttrace.h Fri Apr 16 15:15:52 2010 +0300 @@ -92,8 +92,6 @@ #endif - - GstTrace* gst_trace_new (gchar *filename, gint size); #ifdef __SYMBIAN32__ IMPORT_C @@ -146,12 +144,14 @@ void gst_trace_read_tsc (gint64 *dst); + + +extern GStaticMutex _gst_trace_mutex; #ifdef __SYMBIAN32__ IMPORT_C #endif - gboolean gst_alloc_trace_available (void); #ifdef __SYMBIAN32__ IMPORT_C @@ -220,11 +220,15 @@ */ #define gst_alloc_trace_new(trace, mem) \ G_STMT_START { \ - if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \ - (trace)->live++; \ - if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \ - (trace)->mem_live = \ - g_slist_prepend ((trace)->mem_live, mem); \ + if (G_UNLIKELY ((trace)->flags)) { \ + g_static_mutex_lock (&_gst_trace_mutex); \ + if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \ + (trace)->live++; \ + if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \ + (trace)->mem_live = \ + g_slist_prepend ((trace)->mem_live, mem); \ + g_static_mutex_unlock (&_gst_trace_mutex); \ + } \ } G_STMT_END /** @@ -236,11 +240,15 @@ */ #define gst_alloc_trace_free(trace, mem) \ G_STMT_START { \ - if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \ - (trace)->live--; \ - if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \ - (trace)->mem_live = \ - g_slist_remove ((trace)->mem_live, mem); \ + if (G_UNLIKELY ((trace)->flags)) { \ + g_static_mutex_lock (&_gst_trace_mutex); \ + if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \ + (trace)->live--; \ + if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \ + (trace)->mem_live = \ + g_slist_remove ((trace)->mem_live, mem); \ + g_static_mutex_unlock (&_gst_trace_mutex); \ + } \ } G_STMT_END #else