private object m_mutex = new object(); private bool m_initialized = false; private BigInstance m_instance = null; public BigInstance Instance { get { if (!this.m_initialized) { lock (this.m_mutex) { if (!this.m_initialized) { this.m_instance = new BigInstance(); this.m_initialized = true; } } } return this.m_instance; } }
时间: 2024-11-15 08:52:22