[vlc-devel] commit: Add callback to spu-esfrom theinput.?(Jean-Paul Saman )

Remi Denis-Courmont rdenis at simphalempin.com
Thu Jun 19 14:14:31 CEST 2008

On Thu, 19 Jun 2008 14:56:42 +0300, Ilkka Ollakka
<ilkka.ollakka+vlc at oamk.fi> wrote:
> On to 19. kesäkuuta 2008 12:14:47, Remi Denis-Courmont wrote:
>> I have to disagree. Adding known bugs is simply wrong, and it is fairly
>> clear that nobody will ever want to fix them - especially not those who
>> added them in the first place.
> We talked about this briefly with j-b this morning (or night for j-b),
> and we're looking the most suitable way to fix this (thou if anyone has
> patch allready at hand, please share, I myself am little tight on time
> atm. )

If it's a pure set/get pattern, you can use vlc_spin_lock/vlc_spin_unlock
around all set/get operations. However, I wonder why use a callback at all
then - you could read the VLC variable from the input-or-whatever object
directly, no? (VLC variables are always thread-safe)

If it's a set/get pattern involving some "slow" operation (memory
allocation, system call, or any operations whose complexity is not
CPU-bound...), then use vlc_mutex_lock/vlc_mutex_unlock instead of spin.

If you need to wakeup the "getter" thread, use a mutex plus a condition
variable, e.g. as in the hotkey plugin.

Rémi Denis-Courmont

More information about the vlc-devel mailing list