diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-10 23:06:08 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-10 23:06:08 +0000 |
commit | f820cfd0f58d4fb904106d599951697c314846ff (patch) | |
tree | 8a6079433025a4a4739e3653a1ccbcd01df3f32f /libstdc++-v3/libsupc++ | |
parent | d4a095183fe69c41106fed3dcc7106b7566b73c5 (diff) | |
download | gcc-f820cfd0f58d4fb904106d599951697c314846ff.tar.gz |
* libsupc++/guard.cc (struct mutex_wrapper): Move into
anonymous namespace.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129218 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/guard.cc | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc index dca37f1f26a..6cf83b1c1f4 100644 --- a/libstdc++-v3/libsupc++/guard.cc +++ b/libstdc++-v3/libsupc++/guard.cc @@ -60,6 +60,20 @@ namespace __gthread_once(&once, init); return *static_mutex; } + + // Simple wrapper for exception safety. + struct mutex_wrapper + { + bool unlock; + mutex_wrapper() : unlock(true) + { get_static_mutex().lock(); } + + ~mutex_wrapper() + { + if (unlock) + static_mutex->unlock(); + } + }; } #ifdef __GTHREAD_HAS_COND @@ -199,22 +213,6 @@ namespace __cxxabiv1 return 1; } - // Simple wrapper for exception safety. - struct mutex_wrapper - { -#ifdef __GTHREADS - bool unlock; - mutex_wrapper() : unlock(true) - { get_static_mutex().lock(); } - - ~mutex_wrapper() - { - if (unlock) - static_mutex->unlock(); - } -#endif - }; - extern "C" int __cxa_guard_acquire (__guard *g) { |