--- a/gstreamer_core/gst/gsttrace.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gstreamer_core/gst/gsttrace.h Wed Mar 24 18:04:17 2010 -0500
@@ -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