trace: don't use deprecated GStaticMutex API in (still) public header

This commit is contained in:
Tim-Philipp Müller 2012-01-22 00:42:34 +00:00
parent dd9f0481ea
commit 612abd89dd
3 changed files with 11 additions and 11 deletions

View file

@ -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 ()));

View file

@ -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__)

View 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