From cf866a84694862cee766b63c80f5bc8d6e213364 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 2 Mar 2016 13:57:07 +0100 Subject: [PATCH] jitterbuffer: Add tracing of lock usage Helps with debugging lock usage https://bugzilla.gnome.org/show_bug.cgi?id=762988 --- gst/rtpmanager/gstrtpjitterbuffer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index ae2bf9da63..0f622ab361 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -173,14 +173,21 @@ enum PROP_RFC7273_SYNC }; -#define JBUF_LOCK(priv) (g_mutex_lock (&(priv)->jbuf_lock)) +#define JBUF_LOCK(priv) G_STMT_START { \ + GST_TRACE("Locking from thread %p", g_thread_self()); \ + (g_mutex_lock (&(priv)->jbuf_lock)); \ + GST_TRACE("Locked from thread %p", g_thread_self()); \ + } G_STMT_END #define JBUF_LOCK_CHECK(priv,label) G_STMT_START { \ JBUF_LOCK (priv); \ if (G_UNLIKELY (priv->srcresult != GST_FLOW_OK)) \ goto label; \ } G_STMT_END -#define JBUF_UNLOCK(priv) (g_mutex_unlock (&(priv)->jbuf_lock)) +#define JBUF_UNLOCK(priv) G_STMT_START { \ + GST_TRACE ("Unlocking from thread %p", g_thread_self ()); \ + (g_mutex_unlock (&(priv)->jbuf_lock)); \ +} G_STMT_END #define JBUF_WAIT_TIMER(priv) G_STMT_START { \ GST_DEBUG ("waiting timer"); \