Exemple #1
0
        static void Main(string[] args)
        {
            Bee bee1 = new Bee(1, 1);
            Bee bee2 = new Bee(3, 2);

            WinnieThePooh.GetInstance(9, 2500);
        }
Exemple #2
0
        public static void GetInstance(int portion, int timeToEat)
        {
            _portion           = portion;
            _timeToEat         = timeToEat;
            _liveWithoutEating = timeToEat;

            if (_winnie == null)
            {
                lock (_lock)
                {
                    if (_winnie == null)
                    {
                        _winnie = new WinnieThePooh();
                    }
                }
            }

            EatHoney();
        }