svn commit: r249993 - head/contrib/libcxxrt

Dimitry Andric dim at FreeBSD.org
Sat Apr 27 19:26:57 UTC 2013


Author: dim
Date: Sat Apr 27 19:26:56 2013
New Revision: 249993
URL: http://svnweb.freebsd.org/changeset/base/249993

Log:
  Merge libcxxrt c812a07cd2f95c1403baf0bbe0366e7618d1d6d3:
  
  * Don't call the _fast version of the TLS accessor in terminate() or
    unexpected().
    1) TLS may not have been set up yet.
    2) When we're in one of these functions, Really Bad Stuff has
       happened and potentially saving a few cycles really isn't
       important.
  * Merge in fixes from FreeBSD trunk to make atomics work with recent
    clang.
  
  MFC after:	1 week

Modified:
  head/contrib/libcxxrt/atomic.h
  head/contrib/libcxxrt/exception.cc
Directory Properties:
  head/contrib/libcxxrt/   (props changed)

Modified: head/contrib/libcxxrt/atomic.h
==============================================================================
--- head/contrib/libcxxrt/atomic.h	Sat Apr 27 18:34:51 2013	(r249992)
+++ head/contrib/libcxxrt/atomic.h	Sat Apr 27 19:26:56 2013	(r249993)
@@ -9,7 +9,7 @@
  * Swap macro that enforces a happens-before relationship with a corresponding
  * ATOMIC_LOAD.
  */
-#if __has_feature(cxx_atomic)
+#if __has_builtin(__c11_atomic_exchange)
 #define ATOMIC_SWAP(addr, val)\
 	__c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL)
 #elif __has_builtin(__sync_swap)
@@ -20,7 +20,7 @@
 	__sync_lock_test_and_set(addr, val)
 #endif
 
-#if __has_feature(cxx_atomic)
+#if __has_builtin(__c11_atomic_load)
 #define ATOMIC_LOAD(addr)\
 	__c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE)
 #else

Modified: head/contrib/libcxxrt/exception.cc
==============================================================================
--- head/contrib/libcxxrt/exception.cc	Sat Apr 27 18:34:51 2013	(r249992)
+++ head/contrib/libcxxrt/exception.cc	Sat Apr 27 19:26:56 2013	(r249993)
@@ -1404,7 +1404,7 @@ namespace std
 	 */
 	void terminate()
 	{
-		static __cxa_thread_info *info = thread_info_fast();
+		static __cxa_thread_info *info = thread_info();
 		if (0 != info && 0 != info->terminateHandler)
 		{
 			info->terminateHandler();
@@ -1421,7 +1421,7 @@ namespace std
 	 */
 	void unexpected()
 	{
-		static __cxa_thread_info *info = thread_info_fast();
+		static __cxa_thread_info *info = thread_info();
 		if (0 != info && 0 != info->unexpectedHandler)
 		{
 			info->unexpectedHandler();


More information about the svn-src-head mailing list