Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jun 2013 08:28:24 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251566 - head/sys/sys
Message-ID:  <201306090828.r598SORB026010@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun Jun  9 08:28:23 2013
New Revision: 251566
URL: http://svnweb.freebsd.org/changeset/base/251566

Log:
  Fix the way atomic_is_lock_free() is defined for Clang.
  
  When using Clang atomics, atomic types are not placed in a structure.
  There is thus no reason why we should get the __val member.

Modified:
  head/sys/sys/stdatomic.h

Modified: head/sys/sys/stdatomic.h
==============================================================================
--- head/sys/sys/stdatomic.h	Sun Jun  9 08:06:26 2013	(r251565)
+++ head/sys/sys/stdatomic.h	Sun Jun  9 08:28:23 2013	(r251566)
@@ -156,7 +156,10 @@ enum memory_order {
  * 7.17.5 Lock-free property.
  */
 
-#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS)
+#if defined(__CLANG_ATOMICS)
+#define	atomic_is_lock_free(obj) \
+	__atomic_is_lock_free(sizeof(*(obj)), obj)
+#elif defined(__GNUC_ATOMICS)
 #define	atomic_is_lock_free(obj) \
 	__atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val)
 #else



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