From: Benjamin Kosnik Date: Tue, 2 Nov 2004 23:56:56 +0000 (+0000) Subject: re PR libstdc++/17627 (M68060 fails with libstdc++-v3/config/cpu/m68k/atomicity.h) X-Git-Tag: releases/gcc-4.0.0~3475 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=656cee9aa2d98addee95f1d2d16be4572a843483;p=thirdparty%2Fgcc.git re PR libstdc++/17627 (M68060 fails with libstdc++-v3/config/cpu/m68k/atomicity.h) 2004-11-02 Benjamin Kosnik Lothar Werzinger PR libstdc++/17627 * src/debug.cc: Include concurrence, use mutexes. (_Safe_iterator_base::_M_attach): Here. (_Safe_iterator_base::_M_detach): Here. Co-Authored-By: Lothar Werzinger From-SVN: r90004 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0b0545302f5b..dbbbea991137 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2004-11-02 Benjamin Kosnik + Lothar Werzinger + + PR libstdc++/17627 + * src/debug.cc: Include concurrence, use mutexes. + (_Safe_iterator_base::_M_attach): Here. + (_Safe_iterator_base::_M_detach): Here. + 2004-11-02 Benjamin Kosnik PR libstdc++/17922 diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc index 0ca9238fe003..fe6bba45fc3b 100644 --- a/libstdc++-v3/src/debug.cc +++ b/libstdc++-v3/src/debug.cc @@ -37,9 +37,17 @@ #include #include #include +#include using namespace std; +namespace __gnu_internal +{ + __glibcxx_mutex_define_initialized(iterator_base_attach_mutex); + __glibcxx_mutex_define_initialized(iterator_base_detach_mutex); + +} // namespace __gnu_internal + namespace __gnu_debug { const char* _S_debug_messages[] = @@ -188,6 +196,7 @@ namespace __gnu_debug // Attach to the new sequence (if there is one) if (__seq) { + __gnu_cxx::lock sentry(__gnu_internal::iterator_base_attach_mutex); _M_sequence = __seq; _M_version = _M_sequence->_M_version; _M_prior = 0; @@ -212,6 +221,7 @@ namespace __gnu_debug _Safe_iterator_base:: _M_detach() { + __gnu_cxx::lock sentry(__gnu_internal::iterator_base_detach_mutex); if (_M_sequence) { // Remove us from this sequence's list