[vlc-devel] [vlc-commits] commit: Safer vlc_atomic_set for win32. (Laurent Aimar )

Rémi Denis-Courmont remi at remlab.net
Fri Jul 2 03:23:32 CEST 2010


----- Message d'origine -----
> On Thu, 2010-07-01 at 20:33 +0200, git at videolan.org wrote:
> > vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jul  1
> > 20:32:44 2010 +0200| [6f9bf4ab7f99b89c6c2d6c977028b34f71095a18] | committer:
> > Laurent Aimar
> >
> > Safer vlc_atomic_set for win32.
>
> The same should probably be done to vlc_atomic_get().
> The only way I see using win32 API is to use InterlockedExchangeAdd(&,
> 0) (or the same idea using And/Xor/Or) but the const in the
> vlc_atomic_get() prototype prevent me to do so.

What's wrong with __sync_synchronize (other than being overkill)? Also, there is probably a reason why the API to get and set do not exist. Most probably they deemed that normal assign/fetch works (which is true on x86 with volatile keyword).



More information about the vlc-devel mailing list