private void CashDeskWork(CashDesk cashDesk, CancellationToken token) { while (!token.IsCancellationRequested) { if (cashDesk.Count > 0) { cashDesk.Dequeue(); Thread.Sleep(CashDeskSpeed); } } }
private void CashDeskWork(CashDesk cashDesk, int sleep) { while (isWorking) { if (cashDesk.Count > 0) { cashDesk.Dequeue(); Thread.Sleep(sleep); } } }