[vlc-devel] [PATCH 2/4] libvlc: media_player: use vlc_atomic_rc for refcount

Rémi Denis-Courmont remi at remlab.net
Mon Nov 23 21:11:19 CET 2020


Le lundi 23 novembre 2020, 12:13:04 EET Romain Vimont a écrit :
> On Mon, Nov 23, 2020 at 11:13:55AM +0200, Rémi Denis-Courmont wrote:
> > Hi,
> > 
> > I don't really the point in using an atomic variable if it can't avoid the
> > mutex.
> 
> But the mutex locking is avoided for refcounting (and this mutex is for
> other things).

On fast path, the mutex locking and unlocking is just one load and two atomic 
ops. I don't really care either way: this patch seems as harmless as useless.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list