Better mutex scope + don’t call wakeAll twice on the wait condition