]> git.sesse.net Git - vlc/commitdiff
Win32: try to fix atomic adds with InterlockedExchangeAdd iso InterlockedAdd
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 28 Jun 2010 23:47:21 +0000 (01:47 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 28 Jun 2010 23:48:00 +0000 (01:48 +0200)
src/win32/atomic.c

index d6f77c249ef937780a1ed5c43dfb65483c252c4b..bf111782b161c1b9152590f4225b9ee91f691a3c 100644 (file)
@@ -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
 }