GNOME Bugzilla – Bug 501562
[switch] bogus locking order
Last modified: 2008-01-12 20:43:29 UTC
The code in gstswitch.c appears to have a locking order of OBJECT_LOCK, SWITCH_LOCK. This is bogus. Although the code attempts to get this right, there are still some errors like in the release_request_pad function: GST_OBJECT_LOCK (gstswitch); gstswitch->nb_sinkpads--; GST_SWITCH_LOCK (gstswitch); if (gstswitch->active_sinkpad == pad) { gst_object_unref (gstswitch->active_sinkpad); gstswitch->active_sinkpad = NULL; if (gstswitch->nb_sinkpads == 0) { GstIterator *iter = gst_element_iterate_sink_pads (GST_ELEMENT (gstswitch)); gpointer active_sinkpad_store = (gpointer) gstswitch->active_sinkpad; The proper solution is to make the locking order SWITCH_LOCK, OBJECT_LOCK.
Happily since I replaced this code, I can close this bug!