X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Fsrc%2Fdebug.cc;h=3375adf1f4720fd8082e2183852fed238057d795;hb=c586733cf4a83b317b94681d368cd3231021ab7e;hp=0ca9238fe00395bc15c7992dc4572e49c2050d6e;hpb=429682edf6456976455c188a2e7ad0d6894392b3;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc index 0ca9238fe00..3375adf1f47 100644 --- a/libstdc++-v3/src/debug.cc +++ b/libstdc++-v3/src/debug.cc @@ -1,6 +1,6 @@ // Debugging mode support code -*- C++ -*- -// Copyright (C) 2003, 2004 +// Copyright (C) 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -37,9 +37,15 @@ #include #include #include +#include using namespace std; +namespace __gnu_internal +{ + __glibcxx_mutex_define_initialized(iterator_base_mutex); +} // namespace __gnu_internal + namespace __gnu_debug { const char* _S_debug_messages[] = @@ -188,6 +194,7 @@ namespace __gnu_debug // Attach to the new sequence (if there is one) if (__seq) { + __gnu_cxx::lock sentry(__gnu_internal::iterator_base_mutex); _M_sequence = __seq; _M_version = _M_sequence->_M_version; _M_prior = 0; @@ -212,6 +219,7 @@ namespace __gnu_debug _Safe_iterator_base:: _M_detach() { + __gnu_cxx::lock sentry(__gnu_internal::iterator_base_mutex); if (_M_sequence) { // Remove us from this sequence's list @@ -499,7 +507,7 @@ namespace __gnu_debug template void _Error_formatter::_M_format_word(char* __buf, - int __n __attribute__((__unused__)), + int __n __attribute__ ((__unused__)), const char* __fmt, _Tp __s) const { #ifdef _GLIBCXX_USE_C99 @@ -645,21 +653,20 @@ namespace __gnu_debug // Instantiations. template void - _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt, - const void* __s) const; + _Error_formatter::_M_format_word(char*, int, const char*, + const void*) const; template void - _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt, - long __s) const; + _Error_formatter::_M_format_word(char*, int, const char*, long) const; template void - _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt, - std::size_t __s) const; + _Error_formatter::_M_format_word(char*, int, const char*, + std::size_t) const; template void - _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt, - const char* __s) const; + _Error_formatter::_M_format_word(char*, int, const char*, + const char*) const; } // namespace __gnu_debug