[vlc-commits] commit: Win32: try to fix atomic adds with InterlockedExchangeAdd iso InterlockedAdd ( Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Tue Jun 29 01:47:57 CEST 2010
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jun 29 01:47:21 2010 +0200| [bde1898a73522e268bbe43c6f5d4da27c4681a45] | committer: Jean-Baptiste Kempf
Win32: try to fix atomic adds with InterlockedExchangeAdd iso InterlockedAdd
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bde1898a73522e268bbe43c6f5d4da27c4681a45
---
src/win32/atomic.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/win32/atomic.c b/src/win32/atomic.c
index d6f77c2..bf11178 100644
--- a/src/win32/atomic.c
+++ b/src/win32/atomic.c
@@ -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
}
More information about the vlc-commits
mailing list