Skip to content

aggregator: Make the src_lock a fair lock

Add GstFairMutex, a wrapper around GMutex that adds a GCond and a queue in order to make locks and waits fair. Private API.

Then use GstFairMutex for GstAggregator's src_lock. This lock is contended by both the src task and any threads trying to push into the aggregator.

This is problematic when aggregation falls behind and the src task no longer waits for all sink pads to be filled. Since aggregation typically involves at least two sink pads and thus three threads, this lock is highly susceptible to starving one of the sink threads.

Edited by Jan Alexander Steffens

Merge request reports

Loading