More thread-race avoidance