[阅读: 282] 2008-07-04 08:15:05
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;
}