haitao ·
·
阅读: 422
public static LazySingleton getInstance()
{
if (m_instance == null)
{
//More than one threads might be here!!!
//synchronized(LazySingleton.class)
if (mutex_lock(g_xxx))
{
if (m_instance == null)
{
m_instance = new LazySingleton();
}
mutex_unlock(g_xxx);
}
}
return m_instance;
}