#include <Singleton.h>
Static Public Methods | |
LONESOME* | instance () |
Static Protected Attributes | |
LOCK | _lock |
bool | _flag |
LONESOME* | _Instance |
SingletonDestroyer<LONESOME> | _Destroyer |
This is a thread safe wrapper for creating Singleton classes. The Singleton class is of type LONESOME and is automatically constructed the first time it is used, it will then persist for the lifetime of the program.
|
Provide access to the single instance through double-checked locking
|
|
SingletonDestroyer that is created to destroy this Singleton |
|
LONESOME* for the actual object this Singleton is providing access to. |
|
Flag to keep over-aggressive compilers from optimizing away the double check |
|
Mutex used to perform to double-checked locking that makes this Singleton thread safe |