]> git.sesse.net Git - vlc/blobdiff - src/win32/atomic.c
Safer vlc_atomic_set for win32.
[vlc] / 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;
 }