#include <Utilities/General/interface/MutexUtils.h>
Static Public Member Functions | |
static T & | instance (F &f=factory()) |
Static Private Member Functions | |
static T * | buildMe (F &f) |
static F & | factory () |
Definition at line 153 of file MutexUtils.h.
static T* ThreadSingleton< T, F >::buildMe | ( | F & | f | ) | [inline, static, private] |
Definition at line 171 of file MutexUtils.h.
References f.
Referenced by ThreadSingleton< T, F >::instance().
00171 { 00172 return f(); 00173 }
static F& ThreadSingleton< T, F >::factory | ( | void | ) | [inline, static, private] |
Definition at line 166 of file MutexUtils.h.
References f.
00166 { 00167 static F f; 00168 return f; 00169 }
static T& ThreadSingleton< T, F >::instance | ( | F & | f = factory() |
) | [inline, static] |
Definition at line 156 of file MutexUtils.h.
References ThreadSingleton< T, F >::buildMe(), f, me, and t.
Referenced by TSafeOstream().
00156 { 00157 static boost::thread_specific_ptr<T> me; 00158 if (!me.get()) { 00159 T * t = buildMe(f); 00160 me.reset(t); 00161 } 00162 return *me; 00163 }