pad: inline the recursive stream lock

This commit is contained in:
Wim Taymans 2011-06-02 13:46:26 +02:00
parent fde7d867bd
commit b5d35162ae
2 changed files with 5 additions and 14 deletions

View file

@ -324,9 +324,7 @@ gst_pad_init (GstPad * pad)
GST_PAD_SET_FLUSHING (pad); GST_PAD_SET_FLUSHING (pad);
/* FIXME 0.11: Store this directly in the instance struct */ g_static_rec_mutex_init (&pad->stream_rec_lock);
pad->stream_rec_lock = g_slice_new (GStaticRecMutex);
g_static_rec_mutex_init (pad->stream_rec_lock);
pad->block_cond = g_cond_new (); pad->block_cond = g_cond_new ();
@ -473,15 +471,8 @@ gst_pad_finalize (GObject * object)
gst_object_unref (task); gst_object_unref (task);
} }
if (pad->stream_rec_lock) { g_static_rec_mutex_free (&pad->stream_rec_lock);
g_static_rec_mutex_free (pad->stream_rec_lock); g_cond_free (pad->block_cond);
g_slice_free (GStaticRecMutex, pad->stream_rec_lock);
pad->stream_rec_lock = NULL;
}
if (pad->block_cond) {
g_cond_free (pad->block_cond);
pad->block_cond = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }

View file

@ -647,7 +647,7 @@ struct _GstPad {
/*< public >*/ /* with STREAM_LOCK */ /*< public >*/ /* with STREAM_LOCK */
/* streaming rec_lock */ /* streaming rec_lock */
GStaticRecMutex *stream_rec_lock; GStaticRecMutex stream_rec_lock;
GstTask *task; GstTask *task;
/*< public >*/ /* with LOCK */ /*< public >*/ /* with LOCK */
@ -764,7 +764,7 @@ struct _GstPadClass {
* Get the stream lock of @pad. The stream lock is protecting the * Get the stream lock of @pad. The stream lock is protecting the
* resources used in the data processing functions of @pad. * resources used in the data processing functions of @pad.
*/ */
#define GST_PAD_GET_STREAM_LOCK(pad) (GST_PAD_CAST(pad)->stream_rec_lock) #define GST_PAD_GET_STREAM_LOCK(pad) (&(GST_PAD_CAST(pad)->stream_rec_lock))
/** /**
* GST_PAD_STREAM_LOCK: * GST_PAD_STREAM_LOCK:
* @pad: a #GstPad * @pad: a #GstPad