mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
multiqueue: avoid lock for taking the counter
The counter for incomming data is already protected with the STREAM_LOCK so we don't need to add another lock around it.
This commit is contained in:
parent
368b7899c0
commit
b95cc5031b
2 changed files with 3 additions and 6 deletions
|
@ -1014,9 +1014,7 @@ gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|||
mq = sq->mqueue;
|
||||
|
||||
/* Get a unique incrementing id */
|
||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||
curid = mq->counter++;
|
||||
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||
|
||||
GST_LOG_OBJECT (mq, "SingleQueue %d : about to enqueue buffer %p with id %d",
|
||||
sq->id, buffer, curid);
|
||||
|
@ -1112,10 +1110,9 @@ gst_multi_queue_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Get an unique incrementing id */
|
||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||
/* Get an unique incrementing id. protected with the STREAM_LOCK, unserialized
|
||||
* events already got pushed and don't end up in the queue. */
|
||||
curid = mq->counter++;
|
||||
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||
|
||||
item = gst_multi_queue_event_item_new ((GstMiniObject *) event, curid);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ struct _GstMultiQueue {
|
|||
|
||||
GstDataQueueSize max_size, extra_size;
|
||||
|
||||
guint32 counter; /* incoming object counter */
|
||||
guint32 counter; /* incoming object counter, protected with STREAM_LOCK */
|
||||
guint32 highid; /* contains highest id of last outputted object */
|
||||
|
||||
GMutex * qlock; /* Global queue lock (vs object lock or individual */
|
||||
|
|
Loading…
Reference in a new issue