Merged 44595, 44638, 44707, 44711, 44728 from trunk to release

[SVN r47341]
This commit is contained in:
Peter Dimov committed 2008-07-12 10:41:24 +00:00
1 parent 0fd94d6d56
commit 774a8d330c
5 files changed
+76 -240

No files matched your search

+19 -8
View File
@@ -28,8 +28,11 @@
#include <boost/detail/bad_weak_ptr.hpp>
#include <boost/detail/sp_counted_base.hpp>
#include <boost/detail/sp_counted_impl.hpp>
#include <memory> // std::auto_ptr
// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
// pull in the TR1 headers: that's why we use this header
// rather than including <memory> directly:
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
#include <functional> // std::less
#include <new> // std::bad_alloc
@@ -321,9 +324,13 @@ public:
weak_count & operator= (shared_count const & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
if(tmp != 0) tmp->weak_add_ref();
if(pi_ != 0) pi_->weak_release();
pi_ = tmp;
if( tmp != pi_ )
{
if(tmp != 0) tmp->weak_add_ref();
if(pi_ != 0) pi_->weak_release();
pi_ = tmp;
}
return *this;
}
@@ -331,9 +338,13 @@ public:
weak_count & operator= (weak_count const & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
if(tmp != 0) tmp->weak_add_ref();
if(pi_ != 0) pi_->weak_release();
pi_ = tmp;
if( tmp != pi_ )
{
if(tmp != 0) tmp->weak_add_ref();
if(pi_ != 0) pi_->weak_release();
pi_ = tmp;
}
return *this;
}
+5 -1
View File
@@ -111,7 +111,11 @@ inline void yield( unsigned k )
}
else
{
struct timespec rqtp = { 0 };
// g++ -Wextra warns on {} or {0}
struct timespec rqtp = { 0, 0 };
// POSIX says that timespec has tv_sec and tv_nsec
// But it doesn't guarantee order or placement
rqtp.tv_sec = 0;
rqtp.tv_nsec = 1000;
+6 -2
View File
@@ -20,7 +20,11 @@
#include <boost/detail/shared_ptr_nmt.hpp>
#else
#include <memory> // for std::auto_ptr
// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
// pull in the TR1 headers: that's why we use this header
// rather than including <memory> directly:
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
#include <boost/assert.hpp>
#include <boost/checked_delete.hpp>
@@ -573,7 +577,7 @@ template<class T> inline T * get_pointer(shared_ptr<T> const & p)
#if !defined(BOOST_NO_IOSTREAM)
#if defined(__GNUC__) && (__GNUC__ < 3)
#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )
template<class Y> std::ostream & operator<< (std::ostream & os, shared_ptr<Y> const & p)
{