From 612abd89ddcbe41d55e5de66411e0159f7d85156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 22 Jan 2012 00:42:34 +0000 Subject: [PATCH] trace: don't use deprecated GStaticMutex API in (still) public header --- gst/gst.c | 4 ++++ gst/gsttrace.c | 8 ++------ gst/gsttrace.h | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gst/gst.c b/gst/gst.c index 320ef6b34a..faaeabd5f0 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -682,6 +682,8 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data, _priv_gst_caps_initialize (); _priv_gst_meta_initialize (); + g_mutex_init (&_gst_trace_mutex); + g_type_class_ref (gst_object_get_type ()); g_type_class_ref (gst_pad_get_type ()); g_type_class_ref (gst_element_factory_get_type ()); @@ -1052,6 +1054,8 @@ gst_deinit (void) _priv_gst_registry_cleanup (); + g_mutex_clear (&_gst_trace_mutex); + g_type_class_unref (g_type_class_peek (gst_object_get_type ())); g_type_class_unref (g_type_class_peek (gst_pad_get_type ())); g_type_class_unref (g_type_class_peek (gst_element_factory_get_type ())); diff --git a/gst/gsttrace.c b/gst/gsttrace.c index b857458b81..47586912c7 100644 --- a/gst/gsttrace.c +++ b/gst/gsttrace.c @@ -66,13 +66,9 @@ #include "gsttrace.h" -GStaticMutex _gst_trace_mutex = G_STATIC_MUTEX_INIT; +GMutex _gst_trace_mutex; -static -#ifdef __inline__ - __inline__ -#endif - void +static inline void read_tsc (gint64 * dst) { #if defined(HAVE_RDTSC) && defined(__GNUC__) diff --git a/gst/gsttrace.h b/gst/gsttrace.h index 786a940840..b49ff7cfb0 100644 --- a/gst/gsttrace.h +++ b/gst/gsttrace.h @@ -124,7 +124,7 @@ void _gst_trace_add_entry (GstTrace *trace, guint32 seq, void gst_trace_read_tsc (gint64 *dst); -GST_EXPORT GStaticMutex _gst_trace_mutex; +GST_EXPORT GMutex _gst_trace_mutex; gboolean gst_alloc_trace_available (void); const GList* gst_alloc_trace_list (void); @@ -159,13 +159,13 @@ void gst_alloc_trace_set_flags (GstAllocTrace *trace, G #define gst_alloc_trace_new(trace, mem) \ G_STMT_START { \ if (G_UNLIKELY ((trace)->flags)) { \ - g_static_mutex_lock (&_gst_trace_mutex); \ + g_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_mutex_unlock (&_gst_trace_mutex); \ } \ } G_STMT_END @@ -179,13 +179,13 @@ G_STMT_START { \ #define gst_alloc_trace_free(trace, mem) \ G_STMT_START { \ if (G_UNLIKELY ((trace)->flags)) { \ - g_static_mutex_lock (&_gst_trace_mutex); \ + g_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_mutex_unlock (&_gst_trace_mutex); \ } \ } G_STMT_END