コード例 #1
0
        public static ThreadSingleton Instance()
        {
            if (instance == null)
            {
                instance = new ThreadSingleton();
            }

            return(instance);
        }
コード例 #2
0
ファイル: Singleton.cs プロジェクト: JakubGrobelny/University
        public static ThreadSingleton Instance()
        {
            // nie potrzebujemy blokady, bo każdy wątek powinien
            // utworzyć swoją własną kopię
            if (instance == null)
            {
                instance = new ThreadSingleton();
            }

            return(instance);
        }