]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/17627 (M68060 fails with libstdc++-v3/config/cpu/m68k/atomicity.h)
authorBenjamin Kosnik <bkoz@redhat.com>
Tue, 2 Nov 2004 23:56:56 +0000 (23:56 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 2 Nov 2004 23:56:56 +0000 (23:56 +0000)
2004-11-02  Benjamin Kosnik  <bkoz@redhat.com>
       Lothar Werzinger  <lothar@xcerla.com>

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 <lothar@xcerla.com>
From-SVN: r90004

libstdc++-v3/ChangeLog
libstdc++-v3/src/debug.cc

index 0b0545302f5b273dc6b686845ce594a984df2378..dbbbea991137f377063ef62ca2fb7a7e3d0f1c64 100644 (file)
@@ -1,3 +1,11 @@
+2004-11-02  Benjamin Kosnik  <bkoz@redhat.com>
+           Lothar Werzinger  <lothar@xcerla.com>
+       
+       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  <bkoz@redhat.com>
 
        PR libstdc++/17922
index 0ca9238fe00395bc15c7992dc4572e49c2050d6e..fe6bba45fc3b21d6ec3857bc78f4b59acf3e12d0 100644 (file)
 #include <cstring>
 #include <cstdio>
 #include <cctype>
+#include <bits/concurrence.h>
 
 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