Revision: 34692
http://sourceforge.net/p/opalvoip/code/34692
Author: rjongbloed
Date: 2016-03-18 18:04:37 +0000 (Fri, 18 Mar 2016)
Log Message:
-----------
Added template specialisation for PSafeSingleton<>
Modified Paths:
--------------
ptlib/trunk/include/ptlib/atomic.h
Modified: ptlib/trunk/include/ptlib/atomic.h
===================================================================
--- ptlib/trunk/include/ptlib/atomic.h 2016-03-16 11:12:42 UTC (rev 34691)
+++ ptlib/trunk/include/ptlib/atomic.h 2016-03-18 18:04:37 UTC (rev 34692)
@@ -262,6 +262,14 @@
bool TestAndSet(bool value) { return exchange(value); }
};
+
+// Template class for thread safe singleton
+template <class Type, Type * (*Creator)() = PSingletonCreatorDefault<Type> >
+class PSafeSingleton : public PSingleton<Type, atomic<unsigned>, Creator>
+{
+};
+
+
#endif // PTLIB_CRITICALSECTION_H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|