[gst-devel] thread unsafety in gst_pad_get_internal_links()

Olivier Crête olivier.crete at collabora.co.uk
Tue Aug 26 01:20:14 CEST 2008


Hello,

I just noticed that gst_pad_get_internal_links() is not thread safe. It
does not take the object lock while looking up the list of pads and does
not reference the pads. So its very possible that it could happen in the
middle of a modification of the list (lets say if I add a pad to a tee).
Or that the pad could be gone by the time I get to do something with it.

I propose deprecating it (since we can't modify it without breaking the
ABI) and add a new call get_internal_links_safe() that will returns a
list of refed pads. And fixing the default implementation of boths to be
thread safe (and probably having the default implementation of the
unsafe version call the safe version and unref the pads).

-- 
Olivier Crête
olivier.crete at collabora.co.uk
Collabora Ltd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080825/e2a4c6df/attachment.pgp>


More information about the gstreamer-devel mailing list