gst/: Right, two problems here: ghostpads don't take locks and glib _rec_mutex_lock_full() with depth==0 still locks.

Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
(gst_basesink_handle_object), (gst_basesink_event),
(gst_basesink_do_sync), (gst_basesink_handle_event),
(gst_basesink_change_state):
* gst/gsttask.h:
Right, two problems here: ghostpads don't take locks and
glib _rec_mutex_lock_full() with depth==0 still locks.
Catch illegal locking and g_warn them.
This commit is contained in:
Wim Taymans 2005-06-25 19:37:59 +00:00
parent 849bfaf419
commit 97194517fe
4 changed files with 29 additions and 2 deletions

View file

@ -1,3 +1,14 @@
2005-06-25 Wim Taymans <wim@fluendo.com>
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
(gst_basesink_handle_object), (gst_basesink_event),
(gst_basesink_do_sync), (gst_basesink_handle_event),
(gst_basesink_change_state):
* gst/gsttask.h:
Right, two problems here: ghostpads don't take locks and
glib _rec_mutex_lock_full() with depth==0 still locks.
Catch illegal locking and g_warn them.
2005-06-25 Wim Taymans <wim@fluendo.com>
* check/states/sinks.c: (START_TEST), (gst_object_suite):

View file

@ -466,6 +466,11 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad,
/* have to release STREAM_LOCK as we cannot take the STATE_LOCK
* inside the STREAM_LOCK */
t = GST_STREAM_UNLOCK_FULL (pad);
GST_DEBUG ("released stream lock %d times", t);
if (t == 0) {
GST_WARNING ("STREAM_LOCK should have been locked !!");
g_warning ("STREAM_LOCK should have been locked !!");
}
/* now we commit our state */
GST_STATE_LOCK (basesink);
@ -474,7 +479,9 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad,
GST_STATE_UNLOCK (basesink);
/* reacquire stream lock, pad could be flushing now */
GST_STREAM_LOCK_FULL (pad, t);
/* FIXME in glib, if t==0, the lock is still taken... hmmm */
if (t > 0)
GST_STREAM_LOCK_FULL (pad, t);
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))

View file

@ -57,6 +57,8 @@ typedef enum {
#define GST_TASK_GET_LOCK(task) (GST_TASK_CAST(task)->lock)
#define GST_TASK_LOCK(task) g_static_rec_mutex_lock(GST_TASK_GET_LOCK(task))
#define GST_TASK_UNLOCK(task) g_static_rec_mutex_unlock(GST_TASK_GET_LOCK(task))
#define GST_TASK_UNLOCK_FULL(task) g_static_rec_mutex_unlock_full(GST_TASK_GET_LOCK(task))
#define GST_TASK_LOCK_FULL(task,t) g_static_rec_mutex_lock_full(GST_TASK_GET_LOCK(task),(t))
struct _GstTask {
GstObject object;

View file

@ -466,6 +466,11 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad,
/* have to release STREAM_LOCK as we cannot take the STATE_LOCK
* inside the STREAM_LOCK */
t = GST_STREAM_UNLOCK_FULL (pad);
GST_DEBUG ("released stream lock %d times", t);
if (t == 0) {
GST_WARNING ("STREAM_LOCK should have been locked !!");
g_warning ("STREAM_LOCK should have been locked !!");
}
/* now we commit our state */
GST_STATE_LOCK (basesink);
@ -474,7 +479,9 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad,
GST_STATE_UNLOCK (basesink);
/* reacquire stream lock, pad could be flushing now */
GST_STREAM_LOCK_FULL (pad, t);
/* FIXME in glib, if t==0, the lock is still taken... hmmm */
if (t > 0)
GST_STREAM_LOCK_FULL (pad, t);
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))