Beispiel #1
0
        private void ServeGuests()
        {
            var ct = cts.Token;

            while (ct.IsCancellationRequested == false)
            {
                if (Pub.CanEmployeesLeave())
                {
                    GoHome();
                    return;
                }
                ServeNextPatron();
            }
        }
Beispiel #2
0
        private void StartWorking()
        {
            var ct = cts.Token;

            while (ct.IsCancellationRequested == false)
            {
                if (Pub.CanEmployeesLeave())
                {
                    GoHome();
                    return;
                }
                FetchGlasses();
                WashDishes();
                ReturnCleanGlasses();
            }
        }