The sleeping barber problem