[vlc-devel] commit: Lua SD: let the user know we are working (Fabio Ritrovato )

Rémi Denis-Courmont remi at remlab.net
Wed Feb 24 18:44:58 CET 2010


Le mercredi 24 février 2010 19:09:48 Fabio Ritrovato, vous avez écrit :
> 2010/2/24 Rémi Denis-Courmont <remi at remlab.net>:
> > On Wed, 24 Feb 2010 15:32:10 +0100, Jakob Leben <jakob.leben at gmail.com>
> >
> > wrote:
> >> Well, I assumed that reading and writing a boolean from two different
> >> threads (SD and intf) might not be safe - could result in corrupted data
> >> being read. But maybe it is safe to assume that it is always atomic.
> >
> > No. But why would you do it from different threads?
> 
> Because the point of the patch is giving this information to the
> interface, and that's a different thread than the SD, so if it's not
> safe we'll need the lock...

And I'm saying the lock does not fix that HIGHER LEVEL synchronization problem 
(emphasis added).

> > Then registering a VLC object variable is much easier and provide
> > built-in thread-safety and publish/subscribe.
> 
> We need both the p_sd and the bool (the first to get the sd info, the
> second to get the status) , so you say it's better to have 2 variables
> instead of 1 variable and getting the bool from it?

I'm saying it should be a variable on the SD object.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list