diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-10-13 06:35:15 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@gcc.gnu.org> | 2002-10-13 06:35:15 +0000 |
commit | 9cfa1155757fdd5bf3d8107879fe1462b2889600 (patch) | |
tree | 546f24b65fe577909770090c623c2ffaafce4ad8 | |
parent | b0b128027b0d4edd4fd5205da03bf964714e54cd (diff) | |
download | gcc-9cfa1155757fdd5bf3d8107879fe1462b2889600.zip gcc-9cfa1155757fdd5bf3d8107879fe1462b2889600.tar.gz gcc-9cfa1155757fdd5bf3d8107879fe1462b2889600.tar.bz2 |
stl_threads.h (_GLIBCPP_mutex, [...]): Declare in namespace __gnu_cxx.
* include/bits/stl_threads.h (_GLIBCPP_mutex,
_GLIBCPP_mutex_init,_GLIBCPP_mutex_address,
_GLIBCPP_mutex_address_init, _GLIBCPP_once):
Declare in namespace __gnu_cxx.
(_STL_mutex_lock::_M_initialize): Qualify __gnu_cxx
names.
Adjust copyright.
From-SVN: r58092
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_threads.h | 20 |
2 files changed, 24 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 94d8107..6c2bfcd 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2002-10-13 Danny Smith <dannysmith@users.sourceforge.net> + + * include/bits/stl_threads.h (_GLIBCPP_mutex, + _GLIBCPP_mutex_init,_GLIBCPP_mutex_address, + _GLIBCPP_mutex_address_init, _GLIBCPP_once): + Declare in namespace __gnu_cxx. + (_STL_mutex_lock::_M_initialize): Qualify __gnu_cxx + names. + Adjust copyright. + 2002-10-12 Benjamin Kosnik <bkoz@redhat.com> * testsuite/abi_check.cc (hash<string>): Specialize. diff --git a/libstdc++-v3/include/bits/stl_threads.h b/libstdc++-v3/include/bits/stl_threads.h index 0150cd5..b21ebdd 100644 --- a/libstdc++-v3/include/bits/stl_threads.h +++ b/libstdc++-v3/include/bits/stl_threads.h @@ -1,6 +1,6 @@ // Threading support -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -126,6 +126,7 @@ namespace std return __result; } #endif +} //namespace std // Locking class. Note that this class *does not have a // constructor*. It must be initialized either statically, with @@ -141,13 +142,18 @@ namespace std // functions, and no private or protected members. #if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) +namespace __gnu_cxx +{ extern __gthread_mutex_t _GLIBCPP_mutex; extern __gthread_mutex_t *_GLIBCPP_mutex_address; extern __gthread_once_t _GLIBCPP_once; extern void _GLIBCPP_mutex_init (void); extern void _GLIBCPP_mutex_address_init (void); +} #endif +namespace std +{ struct _STL_mutex_lock { // The class must be statically initialized with __STL_MUTEX_INITIALIZER. @@ -164,22 +170,24 @@ namespace std // There should be no code in this path given the usage rules above. #elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) if (_M_init_flag) return; - if (__gthread_once (&_GLIBCPP_once, _GLIBCPP_mutex_init) != 0 + if (__gthread_once (&__gnu_cxx::_GLIBCPP_once, + __gnu_cxx::_GLIBCPP_mutex_init) != 0 && __gthread_active_p ()) abort (); - __gthread_mutex_lock (&_GLIBCPP_mutex); + __gthread_mutex_lock (&__gnu_cxx::_GLIBCPP_mutex); if (!_M_init_flag) { // Even though we have a global lock, we use __gthread_once to be // absolutely certain the _M_lock mutex is only initialized once on // multiprocessor systems. - _GLIBCPP_mutex_address = &_M_lock; - if (__gthread_once (&_M_once, _GLIBCPP_mutex_address_init) != 0 + __gnu_cxx::_GLIBCPP_mutex_address = &_M_lock; + if (__gthread_once (&_M_once, + __gnu_cxx::_GLIBCPP_mutex_address_init) != 0 && __gthread_active_p ()) abort (); _M_init_flag = 1; } - __gthread_mutex_unlock (&_GLIBCPP_mutex); + __gthread_mutex_unlock (&__gnu_cxx::_GLIBCPP_mutex); #endif } |