From 33ba2c4722b7438e03c086dbc4526f1e78785f80 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 23 Dec 2011 23:10:37 +0000 Subject: [PATCH] sp_counted_base_aix.hpp: switch to lwsync and builtins. Refs #6308. [SVN r76123] --- .../boost/smart_ptr/detail/sp_counted_base_aix.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp b/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp index a17e6cc..0208678 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp @@ -21,11 +21,15 @@ // #include +#include #include namespace boost { +namespace detail +{ + inline void atomic_increment( int32_t* pw ) { // ++*pw; @@ -39,9 +43,9 @@ inline int32_t atomic_decrement( int32_t * pw ) int32_t originalValue; - __asm__ __volatile__( "sync" ); + __lwsync(); originalValue = fetch_and_add( pw, -1 ); - __asm__ __volatile__( "isync" ); + __isync(); return (originalValue - 1); } @@ -59,9 +63,6 @@ inline int32_t atomic_conditional_increment( int32_t * pw ) } } -namespace detail -{ - class sp_counted_base { private: