Use the signal fence builtin in stdatomic.h when using the clang atomic

builtins, rather than the __asm hack.  Somehow I missed the existence of this
builtin originally and only noticed that it was there when I went to implement
it...

Note: Trunk clang now has support for (most of) the C[++]11 atomics stuff.
Please test!

Approved by:	brooks (mentor)
This commit is contained in:
David Chisnall 2012-01-16 18:19:53 +00:00
parent d83064751a
commit 03c142e762
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230225

View File

@ -104,10 +104,7 @@ enum memory_order {
* 7.17.4 Fences.
*/
#if defined(__CLANG_ATOMICS)
#define atomic_thread_fence(order) __atomic_thread_fence(order)
#define atomic_signal_fence(order) __asm volatile ("" : : : "memory")
#elif defined(__GNUC_ATOMICS)
#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS)
#define atomic_thread_fence(order) __atomic_thread_fence(order)
#define atomic_signal_fence(order) __atomic_signal_fence(order)
#else