[cfe-dev] RFC: __atomic_* support for gcc 4.7 compatibility

Howard Hinnant hhinnant at apple.com
Wed Apr 11 06:27:51 PDT 2012


On Apr 11, 2012, at 5:48 AM, David Chisnall wrote:

> On 10 Apr 2012, at 23:20, Howard Hinnant wrote:
> 
>> Of course.  I'd much rather you be awake when you do this. :-)
> 
> I thought you might...
> 
>>> __atomic_init() is still required for atomic_init() (in both C11 and C++11) - these are currently using __atomic_store, in libc++, so I'll fix them at the same time.
>> 
>> template <class _Tp>
>> inline _LIBCPP_INLINE_VISIBILITY
>> void
>> atomic_init(atomic<_Tp>* __o, _Tp __d)
>> {
>>   __o->__a_ = __d;
>> }
>> 
>> Not right?
> 
> No, because assignments to _Atomic() variables with = are atomic, with sequentially consistent semantics.  This is more or less the opposite of what we want.
> 
> David

I see.  Thanks for the explanation.

Howard




More information about the cfe-dev mailing list