trace: don't use deprecated GStaticMutex API in (still) public header
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 22 Jan 2012 00:42:34 +0000 (00:42 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 22 Jan 2012 00:42:34 +0000 (00:42 +0000)
gst/gst.c
gst/gsttrace.c
gst/gsttrace.h

index 320ef6b..faaeabd 100644 (file)
--- 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 ()));
index b857458..4758691 100644 (file)
 
 #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__)
index 786a940..b49ff7c 100644 (file)
@@ -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