From 3e625c07e826c91c0584ba7316194625dea69bb8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 25 Feb 2014 01:32:19 +0200 Subject: [PATCH] Switch to sp_interlocked.hpp --- .../boost/smart_ptr/detail/atomic_count_win32.hpp | 6 +++--- .../boost/smart_ptr/detail/sp_counted_base_w32.hpp | 14 +++++++------- include/boost/smart_ptr/detail/spinlock_w32.hpp | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/boost/smart_ptr/detail/atomic_count_win32.hpp b/include/boost/smart_ptr/detail/atomic_count_win32.hpp index 60a0569..633e73c 100644 --- a/include/boost/smart_ptr/detail/atomic_count_win32.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_win32.hpp @@ -17,7 +17,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include +#include namespace boost { @@ -35,12 +35,12 @@ public: long operator++() { - return BOOST_INTERLOCKED_INCREMENT( &value_ ); + return BOOST_SP_INTERLOCKED_INCREMENT( &value_ ); } long operator--() { - return BOOST_INTERLOCKED_DECREMENT( &value_ ); + return BOOST_SP_INTERLOCKED_DECREMENT( &value_ ); } operator long() const diff --git a/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp b/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp index ff394dc..4ba509c 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp @@ -24,7 +24,7 @@ // formulation // -#include +#include #include #include @@ -71,7 +71,7 @@ public: void add_ref_copy() { - BOOST_INTERLOCKED_INCREMENT( &use_count_ ); + BOOST_SP_INTERLOCKED_INCREMENT( &use_count_ ); } bool add_ref_lock() // true on success @@ -86,11 +86,11 @@ public: // work around a code generation bug long tmp2 = tmp + 1; - if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp2, tmp ) == tmp2 - 1 ) return true; + if( BOOST_SP_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp2, tmp ) == tmp2 - 1 ) return true; #else - if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true; + if( BOOST_SP_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true; #endif } @@ -98,7 +98,7 @@ public: void release() // nothrow { - if( BOOST_INTERLOCKED_DECREMENT( &use_count_ ) == 0 ) + if( BOOST_SP_INTERLOCKED_DECREMENT( &use_count_ ) == 0 ) { dispose(); weak_release(); @@ -107,12 +107,12 @@ public: void weak_add_ref() // nothrow { - BOOST_INTERLOCKED_INCREMENT( &weak_count_ ); + BOOST_SP_INTERLOCKED_INCREMENT( &weak_count_ ); } void weak_release() // nothrow { - if( BOOST_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 ) + if( BOOST_SP_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 ) { destroy(); } diff --git a/include/boost/smart_ptr/detail/spinlock_w32.hpp b/include/boost/smart_ptr/detail/spinlock_w32.hpp index fb97629..d34e4fc 100644 --- a/include/boost/smart_ptr/detail/spinlock_w32.hpp +++ b/include/boost/smart_ptr/detail/spinlock_w32.hpp @@ -15,7 +15,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include +#include #include // BOOST_COMPILER_FENCE @@ -59,7 +59,7 @@ public: bool try_lock() { - long r = BOOST_INTERLOCKED_EXCHANGE( &v_, 1 ); + long r = BOOST_SP_INTERLOCKED_EXCHANGE( &v_, 1 ); BOOST_COMPILER_FENCE