diff options
| author | Kostya Serebryany <kcc@google.com> | 2010-08-12 22:56:59 +0000 |
|---|---|---|
| committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-08-12 22:56:59 +0000 |
| commit | be335b18a9133f849e2d927abdd945c68fc3c716 (patch) | |
| tree | 0e6c156d49fe7f64d815154ccc4cbd3c33f02455 /libstdc++-v3/src | |
| parent | 644fa7acbdafe5d5c5ddea0e0dd0ca73781500ca (diff) | |
| download | gcc-be335b18a9133f849e2d927abdd945c68fc3c716.tar.gz gcc-be335b18a9133f849e2d927abdd945c68fc3c716.tar.bz2 gcc-be335b18a9133f849e2d927abdd945c68fc3c716.zip | |
c++config (_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE, [...]): Add.
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.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r163210
Diffstat (limited to 'libstdc++-v3/src')
| -rw-r--r-- | libstdc++-v3/src/ios_init.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/src/ios_init.cc b/libstdc++-v3/src/ios_init.cc index 1885d825971..209a324a931 100644 --- a/libstdc++-v3/src/ios_init.cc +++ b/libstdc++-v3/src/ios_init.cc @@ -1,7 +1,7 @@ // Iostreams base classes -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009 +// 2006, 2007, 2008, 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -122,8 +122,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ios_base::Init::~Init() { + // Be race-detector-friendly. For more info see bits/c++config. + _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_S_refcount) if (__gnu_cxx::__exchange_and_add_dispatch(&_S_refcount, -1) == 2) { + _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_S_refcount) // Catch any exceptions thrown by basic_ostream::flush() __try { |
