qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] qemu/atomic.h: add #ifdef guards for stdatomic.h


From: Paolo Bonzini
Subject: Re: [PATCH] qemu/atomic.h: add #ifdef guards for stdatomic.h
Date: Thu, 26 Mar 2020 21:05:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 26/03/20 20:58, Richard Henderson wrote:
>> +
>> +#ifndef atomic_fetch_add
>>  #define atomic_fetch_add(ptr, n) __atomic_fetch_add(ptr, n, 
>> __ATOMIC_SEQ_CST)
>>  #define atomic_fetch_sub(ptr, n) __atomic_fetch_sub(ptr, n, 
>> __ATOMIC_SEQ_CST)
>>  #define atomic_fetch_and(ptr, n) __atomic_fetch_and(ptr, n, 
>> __ATOMIC_SEQ_CST)
>>  #define atomic_fetch_or(ptr, n)  __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST)
>>  #define atomic_fetch_xor(ptr, n) __atomic_fetch_xor(ptr, n, 
>> __ATOMIC_SEQ_CST)
>> +#endif
> Do we really get sequential consistency from <stdatomic.h>?

Yes, it's the default value (to pass a memory order you need
atomic_fetch_*_explicit).

Paolo

> Should we not in fact #undef as a workaround instead?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]