Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 2012 18:19:53 +0000 (UTC)
From:      David Chisnall <theraven@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230225 - head/include
Message-ID:  <201201161819.q0GIJr3E045942@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: theraven
Date: Mon Jan 16 18:19:53 2012
New Revision: 230225
URL: http://svn.freebsd.org/changeset/base/230225

Log:
  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)

Modified:
  head/include/stdatomic.h

Modified: head/include/stdatomic.h
==============================================================================
--- head/include/stdatomic.h	Mon Jan 16 17:31:26 2012	(r230224)
+++ head/include/stdatomic.h	Mon Jan 16 18:19:53 2012	(r230225)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201161819.q0GIJr3E045942>