Commit 9555a7f8 authored by Wim Taymans's avatar Wim Taymans

element: inline the recursice state lock

parent b5d35162
......@@ -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");
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment