Пример #1
0
        public static ThreadSingleton Instance()
        {
            if (instance == null)
            {
                instance = new ThreadSingleton();
            }

            return(instance);
        }
Пример #2
0
        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);
        }