diff options
author | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
commit | 6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch) | |
tree | 91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/include/zthread/GuardedClass.h | |
parent | 2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff) | |
parent | f385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'dep/include/zthread/GuardedClass.h')
-rw-r--r-- | dep/include/zthread/GuardedClass.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dep/include/zthread/GuardedClass.h b/dep/include/zthread/GuardedClass.h index 4ef3879cb08..1a8ac1904df 100644 --- a/dep/include/zthread/GuardedClass.h +++ b/dep/include/zthread/GuardedClass.h @@ -34,25 +34,25 @@ namespace ZThread { * @date <2003-07-20T20:17:34-0400> * @version 2.3.0 * - * A simple wrapper template that uses Guard's to provide + * A simple wrapper template that uses Guard's to provide * serialized access to an objects member functions. */ template <class T, class LockType = Mutex> class GuardedClass { - + LockType _lock; T* _ptr; - + class TransferedScope { public: - + template <class LockType1, class LockType2> static void shareScope(LockHolder<LockType1>& l1, LockHolder<LockType2>& l2) { l1.disable(); l2.getLock().acquire(); } - + template <class LockType1> static void createScope(LockHolder<LockType1>& l) { // Don't acquire the lock when scope the Guard is created @@ -82,9 +82,9 @@ namespace ZThread { GuardedClass(); GuardedClass& operator=(const GuardedClass&); - + public: - + GuardedClass(T* ptr) : _ptr(ptr) {} ~GuardedClass() { if(_ptr) @@ -95,9 +95,9 @@ namespace ZThread { Proxy p(_lock, _ptr); return p; } - + }; - + } // namespace ZThread #endif // __ZTGUARDEDCLASS_H__ |