]> git.sesse.net Git - vlc/commitdiff
Safer vlc_atomic_set for win32.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 1 Jul 2010 18:32:44 +0000 (20:32 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 1 Jul 2010 18:32:44 +0000 (20:32 +0200)
src/win32/atomic.c

index 31106494708612a653d6907bfb6c4cf8236092e3..abadf894ff956e789f3203151284d24a74c67dda 100644 (file)
@@ -34,7 +34,11 @@ uintptr_t vlc_atomic_get (const vlc_atomic_t *atom)
 
 uintptr_t vlc_atomic_set (vlc_atomic_t *atom, uintptr_t v)
 {
-    atom->u = v;
+#if defined (WIN64)
+    InterlockedExchange64 (&atom->u, v);
+#else
+    InterlockedExchange (&atom->u, v);
+#endif
     return v;
 }