中国开发网: 论坛: 程序员情感CBD: 贴子 651697
haitao
那像我这样改应该就可以了。。。。。。。。。
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;
}

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录