using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ServerCore; //============================================================================================= // T 타입 객체를 단일 인스턴스로 생성해 주는 제네릭 클래스 이다. // // author : kangms // //============================================================================================= public abstract class Singleton where T : class, new() { // LazyThreadSafetyMode.ExecutionAndPublication : 멀티스레드 환경에서 처리시 안전하게 처리 한다 !!! (기본 설정) private static readonly Lazy m_instance = new(() => new T()); public static T It => m_instance.Value; public static string getName() { return nameof(T); } }