guard.cc (struct mutex_wrapper): Move into anonymous namespace.

* libsupc++/guard.cc (struct mutex_wrapper): Move into
        anonymous namespace.

From-SVN: r129218
This commit is contained in:
Jason Merrill 2007-10-10 19:06:08 -04:00 committed by Jason Merrill
parent cc8c030d88
commit b0bb87a862
2 changed files with 19 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2007-10-10 Jason Merrill <jason@redhat.com>
* libsupc++/guard.cc (struct mutex_wrapper): Move into
anonymous namespace.
2007-10-10 Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&)): Fix.

View File

@ -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)
{