coarse-graind lock for efficiency