aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2005-11-10 12:03:50 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2005-11-10 12:03:50 +0000
commita15024e630fe34f6ceb12151831664b028b26b09 (patch)
tree8bb1fb80628543ca3351cae27a1958808c8d329c
parentf45ddfe08e2caae7b24895e63e00a7884a2413d8 (diff)
downloadgcc-a15024e630fe34f6ceb12151831664b028b26b09.zip
gcc-a15024e630fe34f6ceb12151831664b028b26b09.tar.gz
gcc-a15024e630fe34f6ceb12151831664b028b26b09.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/tr1/boost_shared_ptr.h9
2 files changed, 10 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 19d2d49..0ca7b0c 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,4 +1,9 @@
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>
Peter Dimov <pdimov@mmltd.net>
* include/tr1/boost_shared_ptr.h (_Sp_counted_base::release):
diff --git a/libstdc++-v3/include/tr1/boost_shared_ptr.h b/libstdc++-v3/include/tr1/boost_shared_ptr.h
index 3eb94fd..2c3e27c 100644
--- a/libstdc++-v3/include/tr1/boost_shared_ptr.h
+++ b/libstdc++-v3/include/tr1/boost_shared_ptr.h
@@ -151,10 +151,10 @@ public:
if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1)
{
dispose();
-
+#ifdef __GTHREADS
_GLIBCXX_READ_MEM_BARRIER;
_GLIBCXX_WRITE_MEM_BARRIER;
-
+#endif
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
destroy();
}
@@ -171,8 +171,10 @@ public:
{
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
{
+#ifdef __GTHREADS
_GLIBCXX_READ_MEM_BARRIER;
_GLIBCXX_WRITE_MEM_BARRIER;
+#endif
destroy();
}
}
@@ -326,7 +328,6 @@ public:
{ return _M_pi ? _M_pi->get_deleter(__ti) : 0; }
};
-
class weak_count
{
private:
@@ -418,6 +419,7 @@ shared_count::shared_count(const weak_count& __r)
__throw_bad_weak_ptr();
}
+
// fwd decls
template<typename _Tp>
class weak_ptr;
@@ -850,7 +852,6 @@ template<typename _Tp>
#endif
} // XXX MT
-
long
use_count() const // never throws
{ return _M_refcount.use_count(); }