A queueing system (M/G1, G2/1/K) is considered in which the service time of a customer entering service depends on whether the queue length, N(t), is above or below a threshold L. The arrival process is Poisson, and the general service times S1 and S2 depend on whether the queue length at the time service is initiated is < L or ≥ L, respectively. Balance equations are given for the stationary probabilities of the Markov process (N(t), X(t)), where X(t) is the remaining service time of the customer currently in service. Exact solutions for the stationary probabilities are constructed for both infinite and finite capacity systems. Asymptotic approximations of the solutions are given, which yield simple formulae for performance measures such as loss rates and tail probabilities. The numerical accuracy of the asymptotic results is tested.