Avoid waking all threads when only one is required.