diff --git a/include/loki/LockingPtr.h b/include/loki/LockingPtr.h index 363329e..8d706ed 100755 --- a/include/loki/LockingPtr.h +++ b/include/loki/LockingPtr.h @@ -41,7 +41,7 @@ namespace Loki the mutex type as a LockingPolicy class. The only requirements for a LockingPolicy class are to provide Lock and Unlock methods. */ - template < typename SharedObject, typename LockingPolicy = Loki::Mutex, + template < typename SharedObject, typename LockingPolicy = LOKI_DEFAULT_MUTEX, template class ConstPolicy = NonConstObject > class LockingPtr { @@ -98,7 +98,7 @@ namespace Loki }; // end class LockingPtr - template + template struct Locking { typedef LockingPtr Ptr; @@ -112,7 +112,7 @@ namespace Loki a const SharedObject instead of a mutuable SharedObject. @see LockingPtr */ - template < typename SharedObject, typename LockingPolicy = Loki::Mutex > + template < typename SharedObject, typename LockingPolicy = LOKI_DEFAULT_MUTEX > class ConstLockingPtr { public: @@ -175,6 +175,9 @@ namespace Loki // $Log$ +// Revision 1.7 2006/01/22 13:37:33 syntheticpp +// use macro LOKI_DEFAULT_MUTEX for Mutex default value, defined in Threads.h +// // Revision 1.6 2006/01/21 14:09:09 syntheticpp // replace LockPtr/ConstLockPtr implementation with a template policy based one // diff --git a/include/loki/Singleton.h b/include/loki/Singleton.h index 0609a77..d1a85a6 100644 --- a/include/loki/Singleton.h +++ b/include/loki/Singleton.h @@ -707,7 +707,7 @@ namespace Loki template class CreationPolicy = CreateUsingNew, template class LifetimePolicy = DefaultLifetime, template class ThreadingModel = LOKI_DEFAULT_THREADING_NO_OBJ_LEVEL, - class MutexPolicy = Mutex + class MutexPolicy = LOKI_DEFAULT_MUTEX > class SingletonHolder { @@ -841,6 +841,9 @@ namespace Loki #endif // SINGLETON_INC_ // $Log$ +// Revision 1.24 2006/01/22 13:37:33 syntheticpp +// use macro LOKI_DEFAULT_MUTEX for Mutex default value, defined in Threads.h +// // Revision 1.23 2006/01/22 00:44:17 syntheticpp // add additional template parameter for the changed threading classes // diff --git a/include/loki/SmallObj.h b/include/loki/SmallObj.h index 6abe1fc..f76c01b 100644 --- a/include/loki/SmallObj.h +++ b/include/loki/SmallObj.h @@ -217,7 +217,7 @@ namespace Loki std::size_t maxSmallObjectSize = LOKI_MAX_SMALL_OBJECT_SIZE, std::size_t objectAlignSize = LOKI_DEFAULT_OBJECT_ALIGNMENT, template class LifetimePolicy = LOKI_DEFAULT_SMALLOBJ_LIFETIME, - class MutexPolicy = Mutex + class MutexPolicy = LOKI_DEFAULT_MUTEX > class AllocatorSingleton : public SmallObjAllocator { @@ -577,7 +577,7 @@ namespace Loki std::size_t maxSmallObjectSize = LOKI_MAX_SMALL_OBJECT_SIZE, std::size_t objectAlignSize = LOKI_DEFAULT_OBJECT_ALIGNMENT, template class LifetimePolicy = LOKI_DEFAULT_SMALLOBJ_LIFETIME, - class MutexPolicy = Mutex + class MutexPolicy = LOKI_DEFAULT_MUTEX > class SmallObject : public SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > @@ -613,7 +613,7 @@ namespace Loki std::size_t maxSmallObjectSize = LOKI_MAX_SMALL_OBJECT_SIZE, std::size_t objectAlignSize = LOKI_DEFAULT_OBJECT_ALIGNMENT, template class LifetimePolicy = LOKI_DEFAULT_SMALLOBJ_LIFETIME, - class MutexPolicy = Mutex + class MutexPolicy = LOKI_DEFAULT_MUTEX > class SmallValueObject : public SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > @@ -633,6 +633,9 @@ namespace Loki // Nov. 26, 2004: re-implemented by Rich Sposato. // // $Log$ +// Revision 1.26 2006/01/22 13:37:33 syntheticpp +// use macro LOKI_DEFAULT_MUTEX for Mutex default value, defined in Threads.h +// // Revision 1.25 2006/01/22 13:31:45 syntheticpp // add additional template parameter for the changed threading classes // diff --git a/include/loki/Threads.h b/include/loki/Threads.h index 8b5096b..0e0fc87 100644 --- a/include/loki/Threads.h +++ b/include/loki/Threads.h @@ -74,6 +74,9 @@ #endif +#ifndef LOKI_DEFAULT_MUTEX +#define LOKI_DEFAULT_MUTEX ::Loki::Mutex +#endif #if defined(_WINDOWS_) || defined(_WINDOWS_H) @@ -176,7 +179,7 @@ namespace Loki /// Implementation of the ThreadingModel policy used by various classes /// Implements a single-threaded model; no synchronization //////////////////////////////////////////////////////////////////////////////// - template + template class SingleThreaded { public: @@ -228,7 +231,7 @@ namespace Loki /// Implementation of the ThreadingModel policy used by various classes /// Implements a object-level locking scheme //////////////////////////////////////////////////////////////////////////////// - template < class Host, class MutexPolicy = Loki::Mutex > + template < class Host, class MutexPolicy = LOKI_DEFAULT_MUTEX > class ObjectLevelLockable { mutable MutexPolicy mtx_; @@ -295,7 +298,7 @@ namespace Loki /// Implementation of the ThreadingModel policy used by various classes /// Implements a class-level locking scheme //////////////////////////////////////////////////////////////////////////////// - template + template class ClassLevelLockable { struct Initializer @@ -392,6 +395,9 @@ namespace Loki #endif // $Log$ +// Revision 1.26 2006/01/22 13:37:33 syntheticpp +// use macro LOKI_DEFAULT_MUTEX for Mutex default value, defined in Threads.h +// // Revision 1.25 2006/01/22 00:32:29 syntheticpp // add dummy Mutex for single threading and additional template parameter //