From 801f070a7de3bad358cb0a44ea2194823e9d850a Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 21 Jan 2009 12:19:02 +0100 Subject: [PATCH] Fix for broken logic of the ClassLock (showed up on Ubuntu Hardy) this was nice copy-n-paster error, of course the implementation namespace was never intended to be anonymous. --- src/lib/sync-classlock.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/sync-classlock.hpp b/src/lib/sync-classlock.hpp index 2cb37d17a..ea2c1a75d 100644 --- a/src/lib/sync-classlock.hpp +++ b/src/lib/sync-classlock.hpp @@ -41,22 +41,22 @@ namespace lib { - namespace { // implementation details + namespace nifty { // implementation details template - struct NiftyHolder + struct Holder { static uint accessed_; static char content_[sizeof(X)]; - NiftyHolder() + Holder() { if (!accessed_) new(content_) X(); ++accessed_; } - ~NiftyHolder() + ~Holder() { --accessed_; if (0==accessed_) @@ -73,12 +73,12 @@ namespace lib { }; template - uint NiftyHolder::accessed_; + uint Holder::accessed_; template - char NiftyHolder::content_[sizeof(X)]; + char Holder::content_[sizeof(X)]; - } // (End) implementation details + } // (End) nifty implementation details @@ -100,14 +100,14 @@ namespace lib { Monitor& getPerClassMonitor() { - static NiftyHolder __used_here; + static nifty::Holder __used_here; return __used_here.get(); } public: ClassLock() : Lock (getPerClassMonitor()) {} - uint use_count() { return NiftyHolder::accessed_; } + uint use_count() { return nifty::Holder::accessed_; } };