1 2 3 4 5 6 7 | #define CompletePreviousWritesBeforeFutureWrites asm volatile("" ::: "memory"); inline uint32 AtomicCompareExchangeUInt32(uint32 volatile *Value, uint32 Expected, uint32 New) { uint32 Result = __sync_bool_compare_and_swap(Value, Expected, New); return(Result); } |
asm volatile("" ::: "memory") seems to be a equivalent to _ReadWriteBarrier rather than _WriteBarrier. Is there a better option for GCC? Also I am not sure if this is supported by LLVM.
/Kim