mirror of git://gcc.gnu.org/git/gcc.git
boost_shared_ptr.h (_Sp_counted_base::release, [...]): Protect barriers with __GTHREADS.
2005-11-10 Paolo Carlini <pcarlini@suse.de> * include/tr1/boost_shared_ptr.h (_Sp_counted_base::release, weak_release): Protect barriers with __GTHREADS. From-SVN: r106733
This commit is contained in:
parent
f45ddfe08e
commit
a15024e630
|
|
@ -1,3 +1,8 @@
|
||||||
|
2005-11-10 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
|
* include/tr1/boost_shared_ptr.h (_Sp_counted_base::release,
|
||||||
|
weak_release): Protect barriers with __GTHREADS.
|
||||||
|
|
||||||
2005-11-10 Paolo Carlini <pcarlini@suse.de>
|
2005-11-10 Paolo Carlini <pcarlini@suse.de>
|
||||||
Peter Dimov <pdimov@mmltd.net>
|
Peter Dimov <pdimov@mmltd.net>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,10 +151,10 @@ public:
|
||||||
if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1)
|
if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1)
|
||||||
{
|
{
|
||||||
dispose();
|
dispose();
|
||||||
|
#ifdef __GTHREADS
|
||||||
_GLIBCXX_READ_MEM_BARRIER;
|
_GLIBCXX_READ_MEM_BARRIER;
|
||||||
_GLIBCXX_WRITE_MEM_BARRIER;
|
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||||
|
#endif
|
||||||
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
|
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
|
|
@ -171,8 +171,10 @@ public:
|
||||||
{
|
{
|
||||||
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
|
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
|
||||||
{
|
{
|
||||||
|
#ifdef __GTHREADS
|
||||||
_GLIBCXX_READ_MEM_BARRIER;
|
_GLIBCXX_READ_MEM_BARRIER;
|
||||||
_GLIBCXX_WRITE_MEM_BARRIER;
|
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||||
|
#endif
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -326,7 +328,6 @@ public:
|
||||||
{ return _M_pi ? _M_pi->get_deleter(__ti) : 0; }
|
{ return _M_pi ? _M_pi->get_deleter(__ti) : 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class weak_count
|
class weak_count
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
@ -418,6 +419,7 @@ shared_count::shared_count(const weak_count& __r)
|
||||||
__throw_bad_weak_ptr();
|
__throw_bad_weak_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// fwd decls
|
// fwd decls
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
class weak_ptr;
|
class weak_ptr;
|
||||||
|
|
@ -850,7 +852,6 @@ template<typename _Tp>
|
||||||
#endif
|
#endif
|
||||||
} // XXX MT
|
} // XXX MT
|
||||||
|
|
||||||
|
|
||||||
long
|
long
|
||||||
use_count() const // never throws
|
use_count() const // never throws
|
||||||
{ return _M_refcount.use_count(); }
|
{ return _M_refcount.use_count(); }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue