From: Sebastian Dröge Date: Fri, 14 May 2010 15:13:17 +0000 (+0200) Subject: playsink: Fix deadlock caused from an additional lock instead of unlock X-Git-Tag: RELEASE-0.10.30~193 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5304c30406e6f5c50d16cb82436de768f5fb675;p=platform%2Fupstream%2Fgst-plugins-base.git playsink: Fix deadlock caused from an additional lock instead of unlock Also improve debug output for the playsink lock. --- diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 565bbc1..abf0210 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -112,8 +112,15 @@ typedef struct } GstPlayTextChain; #define GST_PLAY_SINK_GET_LOCK(playsink) (&((GstPlaySink *)playsink)->lock) -#define GST_PLAY_SINK_LOCK(playsink) g_static_rec_mutex_lock (GST_PLAY_SINK_GET_LOCK (playsink)) -#define GST_PLAY_SINK_UNLOCK(playsink) g_static_rec_mutex_unlock (GST_PLAY_SINK_GET_LOCK (playsink)) +#define GST_PLAY_SINK_LOCK(playsink) G_STMT_START { \ + GST_LOG_OBJECT (playsink, "locking from thread %p", g_thread_self ()); \ + g_static_rec_mutex_lock (GST_PLAY_SINK_GET_LOCK (playsink)); \ + GST_LOG_OBJECT (playsink, "locked from thread %p", g_thread_self ()); \ +} G_STMT_END +#define GST_PLAY_SINK_UNLOCK(playsink) G_STMT_START { \ + GST_LOG_OBJECT (playsink, "unlocking from thread %p", g_thread_self ()); \ + g_static_rec_mutex_unlock (GST_PLAY_SINK_GET_LOCK (playsink)); \ +} G_STMT_END struct _GstPlaySink { @@ -1995,7 +2002,7 @@ gst_play_sink_reconfigure (GstPlaySink * playsink) GST_ELEMENT_ERROR (playsink, STREAM, FORMAT, (_("Can't play a text file without video or visualizations.")), ("Have text pad but no video pad or visualizations")); - GST_PLAY_SINK_LOCK (playsink); + GST_PLAY_SINK_UNLOCK (playsink); return FALSE; } }