------------memMgr--LogMgr----
class foo
{
public:
static foo* instance();
private:
foo() {}
~foo() {}
static foo* smInstance;
static Lock smMutex;
};
foo* foo::smInstance = NULL;
Lock foo::smMutex;
foo* foo::instance()
{
LockLocker lock(&smMutex);
if (smInstance == NULL)
smInstance = new foo();
return smInstance;
}
Wednesday, August 19, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment