12 #ifndef __UT_Singleton__
13 #define __UT_Singleton__
25 template <
typename T,
class LOCK>
27 UTacquireSingleton(
T *
volatile &p, LOCK &
lock)
76 template <
typename T,
class LOCK,
typename S>
78 UTacquireSingleton(
T *
volatile &p, LOCK &lock,
S s)
131 template <
typename T,
bool DESTRUCTONEXIT=false>
144 template <
class LOCK>
147 return UTacquireSingleton(myPointer, lock);
150 template <
class LOCK,
typename S>
153 return UTacquireSingleton(myPointer, lock, s);
159 template <
class LOCK>
183 T *
volatile myPointer;
233 template <
typename T,
bool DESTRUCTONEXIT=false,
class LOCK=UT_Lock>
244 template <
typename S>
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void unsafeSet(LOCK &lock, T *newp)
UT_Singleton< T, DESTRUCTONEXIT > Base