GNOME Bugzilla – Bug 619590
[matroskademux] Doesn't protect segment and other fields from concurrent changes from different threads
Last modified: 2011-06-15 22:43:40 UTC
See comment #12 in bug #619485
Is the standard solution to protect such access with the object lock? Apart from event threads and query threads, are there other things that need attention?
Yes, use the object lock if possible but be careful when holding the object lock while calling functions to other elements/pads or the base classes (e.g. gst_object_get_parent() uses the object lock too)
And things that need attention are the query and event functions, the chain/loop functions and the set/get property functions and maybe the state change function.
Created attachment 187174 [details] [review] matroskademux: additional lock safety Patch should take care of remaining items ...
Comment on attachment 187174 [details] [review] matroskademux: additional lock safety I think you don't need to take the object lock when reading the segment from inside the streaming thread, e.g. not in gst_matroska_demux_sync_streams(), because it's only changed from the streaming thread. Other than that this looks good
Yeah, was wondering a bit about that too. But anyway, for good measure ... commit 8b910885ecec02c1974a2689ee06e3bd3f0b8cca Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Wed May 4 11:55:21 2011 +0200 matroskademux: additional lock safety Fixes #619590.