bin: Hold the state lock while removing elements from a bin
authorSebastian Dröge <sebastian@centricular.com>
Mon, 7 Jan 2019 12:08:00 +0000 (14:08 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 7 Jan 2019 12:08:00 +0000 (14:08 +0200)
commit7f70d7a9450b321585fbfd1eb977548d4264b2a6
treebb2c13d5c37a49e6333ce2623c3dabc5af8aa10e
parent41d5f22334e28b5adc35d2d2f6dc4b7c7eb0fa96
bin: Hold the state lock while removing elements from a bin

We need to take the state lock here to ensure that we're
not currently just before setting the state of this child
element. Otherwise it can happen that we removed the element
here and e.g. set it to NULL state, and shortly afterwards
have another thread set it to a higher state again as part of
a state change for the whole bin.

When adding an element to the bin this is not needed as we
require callers to always ensure after adding to the bin that
the new element is set to the correct state.
gst/gstbin.c