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

David Chisnall csdavec at swan.ac.uk
Wed Apr 11 02:48:51 PDT 2012


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



More information about the cfe-dev mailing list