From: Wim Taymans Date: Thu, 2 Jun 2011 12:09:46 +0000 (+0200) Subject: element: inline the recursice state lock X-Git-Tag: RELEASE-0.11.0~192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9555a7f8d088ffaa3f941bf12ee276ef78aca02f;p=platform%2Fupstream%2Fgstreamer.git element: inline the recursice state lock --- diff --git a/gst/gstelement.c b/gst/gstelement.c index 4f28c18..1a01a4d 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -285,8 +285,7 @@ gst_element_init (GstElement * element) GST_STATE_RETURN (element) = GST_STATE_CHANGE_SUCCESS; /* FIXME 0.11: Store this directly in the instance struct */ - element->state_lock = g_slice_new (GStaticRecMutex); - g_static_rec_mutex_init (element->state_lock); + g_static_rec_mutex_init (&element->state_lock); element->state_cond = g_cond_new (); } @@ -2915,14 +2914,8 @@ gst_element_finalize (GObject * object) GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "finalize"); - GST_STATE_LOCK (element); - if (element->state_cond) - g_cond_free (element->state_cond); - element->state_cond = NULL; - GST_STATE_UNLOCK (element); - g_static_rec_mutex_free (element->state_lock); - g_slice_free (GStaticRecMutex, element->state_lock); - element->state_lock = NULL; + g_cond_free (element->state_cond); + g_static_rec_mutex_free (&element->state_lock); GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "finalize parent"); diff --git a/gst/gstelement.h b/gst/gstelement.h index 0fc81ad..538201f 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -487,7 +487,7 @@ G_STMT_START { \ * This lock is used by the core. It is taken while getting or setting * the state, during state changes, and while finalizing. */ -#define GST_STATE_GET_LOCK(elem) (GST_ELEMENT_CAST(elem)->state_lock) +#define GST_STATE_GET_LOCK(elem) (&(GST_ELEMENT_CAST(elem)->state_lock)) /** * GST_STATE_GET_COND: * @elem: a #GstElement @@ -544,7 +544,7 @@ struct _GstElement GstObject object; /*< public >*/ /* with LOCK */ - GStaticRecMutex *state_lock; + GStaticRecMutex state_lock; /* element state */ GCond *state_cond;