User talk:Tgc

From Gnash Project Wiki

Jump to: navigation, search

Tomas, about libmedia, you mention on the wiki that MediaBuffer access is mutex-protected but I believe the protection is currently conceptually bogus. If I'm not wrong there are cases in which you get one end of the list (mutex-protected) then do something with it and finally pop it off the list (mutex-protected). Now, I believe it could be that between initial fetch and final pop other threads could push new elements on it, with the result that the thing you pop is not the one you used before. I think I left a comment in the code about this but I believe Ben found another case w/out the comment.

Since the MediaBuffer is a queue (and not a stack) it shouldn't matter that the first element is read, new elements are pushed onto the end of the queue, and then the first element is deleted. Where in the code is the potential problem?