Skip to content

multiqueue: Fix potential deadlock with parallel release_pad calls

Mart Raudsepp requested to merge leio/gstreamer:fix-multiqueue-deadlock into main

Commit d3a66f98 introduced a potential deadlock with two parallel release_pad calls, where one could release the main multiqueue lock (qlock) while still holding the reconf_lock and then calling other routines which in some conditions may try to acquire qlock again. The second release_pad could already acquire the qlock and then start waiting on reconf_lock, which may never be possible because because the first one isn't releasing it until it can acquire qlock.

Fix it by holding reconf_lock for the whole durationg of qlock, making this particular deadlock impossible.

Fixes #1642 (closed)

Merge request reports