[vlc-devel] [vlc-commits] commit: Atomic operations (currently same ones as in garbage collector) ( Rémi Denis-Courmont?)

Jean-Baptiste Kempf jb at videolan.org
Tue Jun 29 01:46:17 CEST 2010


On Mon, Jun 28, 2010 at 04:31:12PM -0700, Rémi Denis-Courmont wrote :
> ----- Message d'origine -----
> > On Mon, Jun 28, 2010 at 01:31:55AM +0200, git at videolan.org wrote :
> > > +uintptr_t vlc_atomic_add (vlc_atomic_t *atom, uintptr_t v)
> > > +{
> > > +#if defined (WIN64)
> > > +      return InterlockedAdd64 (&atom->s, v);
> > > +#else
> > > +      return InterlockedAdd (&atom->s, v);
> > > +#endif
> > > +}
> >
> > Aren't those only defined in Itanium ? At least MSDN seems to say so.
> 
> I dont know. I would rather use the GCC intrinsics. But VLC 1.0 and 1.1 use InterlockedIncrement so it seemed logical to use InterlockedAdd.

Very well. I believe we should use InterlockedExchangeAdd then.

Why using atom->s and not atom->u btw ?

Best Regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/



More information about the vlc-devel mailing list