Document that pad unlink function is called with pad lock held
A pad's unlink function (set by gst_pad_set_unlink_function) is called with the pad's lock held. This means that any other calls made on the pad hang (because they also try and acquire the mutex).
In the link function, the lock is not held - so the behaviour in the unlink function here is inconsistent, and makes the unlink function unusable for any functional purposes.
Relevant code block in gstpad.c
:
GST_OBJECT_LOCK (srcpad);
GST_OBJECT_LOCK (sinkpad);
if (G_UNLIKELY (GST_PAD_PEER (srcpad) != sinkpad))
goto not_linked_together;
if (GST_PAD_UNLINKFUNC (srcpad)) {
GstObject *tmpparent;
ACQUIRE_PARENT (srcpad, tmpparent, no_src_parent);
GST_PAD_UNLINKFUNC (srcpad) (srcpad, tmpparent);