[vlc-devel] [PATCH 4/6] es_out: replace EsIsSelected function with a variable

Rémi Denis-Courmont remi at remlab.net
Mon Sep 3 17:02:13 CEST 2018


Le lundi 3 septembre 2018, 11:00:49 EEST Steve Lhomme a écrit :
> On 29/08/2018 14:24, Thomas Guillem wrote:
> > It will allow to get the selected state from any threads.
> 
> So an atomic_bool ? Or is there a lock ?

I don't see how an atomic helps.

It would tell you that the ES was selected or not in the very recent past. But 
typically, you probably want to know if the ES is currently selected and take 
an action depending on that. You cannot use an atomic, and you cannot use a 
lock in the accessor either - you would need a lock higher in the call stack.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list