multiqueue: Add another check for the flushing flag after taking the lock

This prevents another potential deadlock when flushing the pad
at exactly the right time.
This commit is contained in:
Sebastian Dröge 2011-04-08 09:07:59 +02:00
parent 80eb160e0f
commit 6d97652903

View file

@ -1115,6 +1115,13 @@ gst_multi_queue_loop (GstPad * pad)
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
/* Check again if we're flushing after the lock is taken,
* the flush flag might have been changed in the meantime */
if (sq->flushing) {
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
goto out_flushing;
}
/* Update the nextid so other threads know when to wake us up */
sq->nextid = newid;