Commit bde1898a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Win32: try to fix atomic adds with InterlockedExchangeAdd iso InterlockedAdd

parent 8940931e
......@@ -25,6 +25,8 @@
#include <vlc_common.h>
#include <vlc_atomic.h>
#include <windows.h>
uintptr_t vlc_atomic_get (const vlc_atomic_t *atom)
{
return atom->u;
......@@ -39,8 +41,8 @@ uintptr_t vlc_atomic_set (vlc_atomic_t *atom, uintptr_t v)
uintptr_t vlc_atomic_add (vlc_atomic_t *atom, uintptr_t v)
{
#if defined (WIN64)
return InterlockedAdd64 (&atom->s, v);
return InterlockedExchangeAdd64 (&atom->s, v);
#else
return InterlockedAdd (&atom->s, v);
return InterlockedExchangeAdd (&atom->s, v);
#endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment