aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/locale_classes.h
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-12 22:56:59 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-12 22:56:59 +0000
commitd8155f717c2ac0ba8a6251bdfa0e50fc90c9a181 (patch)
tree0e6c156d49fe7f64d815154ccc4cbd3c33f02455 /libstdc++-v3/include/bits/locale_classes.h
parent99b66d21e0d1073bc594d7bfaa0422c77db449cc (diff)
2010-08-12 Kostya Serebryany <kcc@google.com>
Paolo Carlini <paolo.carlini@oracle.com> * include/bits/c++config (_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE, _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER): Add. * src/ios_init.cc (ios_base::Init::~Init): Decorate with the latter. * include/tr1_impl/boost_sp_counted_base.h: Likewise. * include/ext/rc_string_base.h: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/basic_string.h: Likewise. * include/bits/ios_base.h: Likewise. * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust dg-error line number. * testsuite/27_io/ios_base/cons/copy_neg.cc: Likewise. * testsuite/ext/profile/mutex_extensions.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163210 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/locale_classes.h')
-rw-r--r--libstdc++-v3/include/bits/locale_classes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h
index 347e7612486..c519f358476 100644
--- a/libstdc++-v3/include/bits/locale_classes.h
+++ b/libstdc++-v3/include/bits/locale_classes.h
@@ -402,8 +402,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void
_M_remove_reference() const throw()
{
+ // Be race-detector-friendly. For more info see bits/c++config.
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount)
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
{
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount)
__try
{ delete this; }
__catch(...)
@@ -508,8 +511,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void
_M_remove_reference() throw()
{
+ // Be race-detector-friendly. For more info see bits/c++config.
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount)
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
{
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount)
__try
{ delete this; }
__catch(...)