Since we're directly reading and writing 'active' from different threads, it needs to be flagged volatile.
authorSam Lantinga <slouken@libsdl.org>
Wed, 26 Jan 2011 19:20:16 -0800
changeset 5102 42a7591530d5
parent 5100 cce11d33d5c6
child 5103 797b37c0c046
Since we're directly reading and writing 'active' from different threads, it needs to be flagged volatile.
test/testatomic.c
--- a/test/testatomic.c	Wed Jan 26 12:23:32 2011 -0800
+++ b/test/testatomic.c	Wed Jan 26 19:20:16 2011 -0800
@@ -278,7 +278,7 @@
     char cache_pad4[CACHELINE-sizeof(SDL_SpinLock)-2*sizeof(SDL_atomic_t)];
 #endif
 
-    SDL_bool active;
+    volatile SDL_bool active;
 
     /* Only needed for the mutex test */
     SDL_mutex *mutex;