diff --git a/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp b/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp index a742c3d..a16d2d8 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp @@ -19,6 +19,7 @@ // #include +#include #include namespace boost @@ -46,15 +47,15 @@ public: // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init #if defined(__hpux) && defined(_DECTHREADS_) - pthread_mutex_init( &m_, pthread_mutexattr_default ); + BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 ); #else - pthread_mutex_init( &m_, 0 ); + BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 ); #endif } virtual ~sp_counted_base() // nothrow { - pthread_mutex_destroy( &m_ ); + BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 ); } // dispose() is called when use_count_ drops to zero, to release @@ -74,24 +75,24 @@ public: void add_ref_copy() { - pthread_mutex_lock( &m_ ); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); ++use_count_; - pthread_mutex_unlock( &m_ ); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); } bool add_ref_lock() // true on success { - pthread_mutex_lock( &m_ ); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); bool r = use_count_ == 0? false: ( ++use_count_, true ); - pthread_mutex_unlock( &m_ ); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); return r; } void release() // nothrow { - pthread_mutex_lock( &m_ ); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); long new_use_count = --use_count_; - pthread_mutex_unlock( &m_ ); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); if( new_use_count == 0 ) { @@ -102,16 +103,16 @@ public: void weak_add_ref() // nothrow { - pthread_mutex_lock( &m_ ); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); ++weak_count_; - pthread_mutex_unlock( &m_ ); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); } void weak_release() // nothrow { - pthread_mutex_lock( &m_ ); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); long new_weak_count = --weak_count_; - pthread_mutex_unlock( &m_ ); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); if( new_weak_count == 0 ) { @@ -121,9 +122,9 @@ public: long use_count() const // nothrow { - pthread_mutex_lock( &m_ ); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); long r = use_count_; - pthread_mutex_unlock( &m_ ); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); return r; }