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

Fabio Ritrovato exsephiroth87 at gmail.com
Wed Feb 24 18:09:48 CET 2010


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...

>>> B: Or remove the b_loading field and pass the loading state as bool
>>> through
>>> callbacks all the way until Qt intf.
>>
>>  Yes, this does probably not need to be kept in the core.
>>
>> I still think it is useful to have that in the core in case an
>> interface wants to know the state even if it missed the state change
>> event.
>
> 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?
Don't we risk having mixed results if 2 different sd try to do it at
the same time?



More information about the vlc-devel mailing list