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 510242a7591530d5
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
     1.1 --- a/test/testatomic.c	Wed Jan 26 12:23:32 2011 -0800
     1.2 +++ b/test/testatomic.c	Wed Jan 26 19:20:16 2011 -0800
     1.3 @@ -278,7 +278,7 @@
     1.4      char cache_pad4[CACHELINE-sizeof(SDL_SpinLock)-2*sizeof(SDL_atomic_t)];
     1.5  #endif
     1.6  
     1.7 -    SDL_bool active;
     1.8 +    volatile SDL_bool active;
     1.9  
    1.10      /* Only needed for the mutex test */
    1.11      SDL_mutex *mutex;